summaryrefslogtreecommitdiff
path: root/src/Scheduling_Jobs_in_Linux.ascii
diff options
context:
space:
mode:
Diffstat (limited to 'src/Scheduling_Jobs_in_Linux.ascii')
-rw-r--r--src/Scheduling_Jobs_in_Linux.ascii73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/Scheduling_Jobs_in_Linux.ascii b/src/Scheduling_Jobs_in_Linux.ascii
new file mode 100644
index 0000000..2bfc61b
--- /dev/null
+++ b/src/Scheduling_Jobs_in_Linux.ascii
@@ -0,0 +1,73 @@
+Linux:Scheduling Jobs
+=====================
+:author: Aaron Ball
+:email: nullspoon@iohq.net
+
+
+== {doctitile}
+
+I was recently needing to schedule the reboot of a print server (Ubuntu), but
+was unsure how. After looking around a bit, I can do all kinds of things with
+it. For a simple use case though, here is how to reboot a server with at...
+
+Since we're restarting the server, we need root privileges for that, so
+we have to run this as sudo this time around. type:
+
+----
+sudo at 23:00
+----
+
+You should see...
+
+----
+warning: commands will be executed using /bin/sh
+at>
+----
+
+Type the command you want to occur at 23:00 (11:00 pm). In our case, we're
+going to restart the server.
+
+----
+shutdown -r now
+----
+
+Press **enter**. From here you press *ctrl+d* and that will save the job for
+later execution.
+
+The cool thing about at is how intuitive it is. For instance, we just used
+23:00 to schedule an e-mail for 11:00 pm. Instead, we could have typed **at
+11:00 pm**. Furthermore, if we wanted to schedule something for tomorrow at
+11:00 pm, we could type **at 11:00 pm tomorrow**. It's a pity for those of us
+who are forgetful...the "at" utility unfortunately does not understand
+yesterday.
+
+That's how to do it.
+
+If you want to list all of the jobs for your user, use the command
+**atq**. If you need to remove a job, use the *atrm* command (this uses
+job numbers from the list atq produces).
+
+Happy scheduling.
+
+... Really, be happy. At least you don't have to be there at 3:00 am to reboot
+the server.
+
+----
+sudo at 3:00 am a> shutdown -r now
+----
+
+* ctrl+d*
+
+...later at 11:30 pm
+
+----
+echo 'ZZZZzzzzzzzzzz...'
+----
+
+
+Category:Linux
+
+Category:Cron
+
+
+// vim: set syntax=asciidoc:

Generated by cgit