From 2f03bc1362f0eb861cc3a1c4abbd4bce546b8994 Mon Sep 17 00:00:00 2001 From: Moti Korets Date: Mon, 1 May 2017 17:06:06 +0700 Subject: [PATCH] at: add page, atq: add page, atrm: add page, and batch: add page (#1344) commands to queue commands execution at specified time or when system load allows --- pages/common/at.md | 16 ++++++++++++++++ pages/common/atq.md | 15 +++++++++++++++ pages/common/atrm.md | 12 ++++++++++++ pages/common/batch.md | 16 ++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 pages/common/at.md create mode 100644 pages/common/atq.md create mode 100644 pages/common/atrm.md create mode 100644 pages/common/batch.md diff --git a/pages/common/at.md b/pages/common/at.md new file mode 100644 index 0000000000..74b2f08c32 --- /dev/null +++ b/pages/common/at.md @@ -0,0 +1,16 @@ +# at + +> Execute commands once at a later time. +> Service atd (or atrun) should be running for the actual executions. + +- Execute commands from standard input in 5 minutes (press `Ctrl + D` after entering commands): + +`at now + 5 min` + +- Execute a command from standard input at 10:00 AM today: + +`echo "{{./make_db_backup.sh}}" | at 1000` + +- Execute commands from a given file next Tuesday: + +`at -f {{path/to/file}} 9:30 PM Tue` diff --git a/pages/common/atq.md b/pages/common/atq.md new file mode 100644 index 0000000000..4b993a4472 --- /dev/null +++ b/pages/common/atq.md @@ -0,0 +1,15 @@ +# atq + +> Show jobs scheduled by `at` or `batch` commands. + +- Show the current user's scheduled jobs: + +`atq` + +- Show jobs from queue named 'a' (queues have single-character names): + +`atq -q {{a}}` + +- Show jobs of all users (run as super user): + +`sudo atq` diff --git a/pages/common/atrm.md b/pages/common/atrm.md new file mode 100644 index 0000000000..f874220c90 --- /dev/null +++ b/pages/common/atrm.md @@ -0,0 +1,12 @@ +# atrm + +> Remove jobs scheduled by `at` or `batch` commands. +> To find job numbers use `atq`. + +- Remove job number 10: + +`atrm {{10}}` + +- Remove many jobs, separated by spaces: + +`atrm {{15}} {{17}} {{22}}` diff --git a/pages/common/batch.md b/pages/common/batch.md new file mode 100644 index 0000000000..d290f2150b --- /dev/null +++ b/pages/common/batch.md @@ -0,0 +1,16 @@ +# batch + +> Execute commands at a later time when the system load levels permit. +> Service atd (or atrun) should be running for the actual executions. + +- Execute a command from standard input: + +`echo "{{./make_db_backup.sh}}" | batch` + +- Execute commands from a given file: + +`batch -f {{path/to/file}}` + +- Execute commands from standard input (press `Ctrl + D` when finished): + +`batch`