At: Difference between revisions

Created page with "== One-time Jobs == You can certainly use cron to run one-time jobs, but that would be more effort than it's worth, since cron is designed for '''repeating''' jobs. The ''..."
 
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
Tags: Mobile edit Mobile web edit
 
Line 6: Line 6:
Since <code>at</code> reads from STDIN, you can just pipe the command to it rather than using the interactive shell: <code>echo "ls -al" | at now + 1 minute</code>  Note that since <code>at</code> runs non-interactively with a different shell, you won't actually '''see''' the results of the 'ls' command.
Since <code>at</code> reads from STDIN, you can just pipe the command to it rather than using the interactive shell: <code>echo "ls -al" | at now + 1 minute</code>  Note that since <code>at</code> runs non-interactively with a different shell, you won't actually '''see''' the results of the 'ls' command.


<source lang="bash">
<syntaxhighlight lang="bash">
echo "shutdown -r now" | at 8am tomorrow
echo "shutdown -r now" | at 8am tomorrow
echo "shutdown -r now" | at midnight 2017-02-25
echo "shutdown -r now" | at midnight 2017-02-25
Line 15: Line 15:
# cancel / remove job 1
# cancel / remove job 1
atrm 1
atrm 1
</source>
</syntaxhighlight>


[[Category:System Administration]]
[[Category:System Administration]]