Help - Search - Members - Calendar
Full Version: Running The At Command
Linuxhelp > Support > Technical Support
Robert83
Hi,

could anyone explain me how to use this at command (managed to learn how to use the date but how to do a command with it ?)

a example would be great

say.... make a dir today at 10:30am for example

please
help me

Sincerely
Robert B
hughesjr
there are different at versions ... I'll discuss the one on wbel...

first, create a script that works ... I saved this as /root/test_script:

QUOTE
#!/bin/bash
cd /root
/bin/touch thisworked


then I did:

chmod 755 /root/test_script

so it can run ...then to run the script now, do this:

at -f test_script now

See if /root/thisworked exists ... if so, it worked! Now remove the directory like this:

rm -rf /root/thisworked

This time we will schedule it at a different time than now ....

at -f test_script 05:53am today

to see what is going to run ... do:

atq

to remove something do:

atrm job_number
hughesjr
You can also pass in commands and then press Ctrl-d like this:

at 06:20am today

you will be at the at> prompt ... type in the commands, like:

touch /root/thisworked (followed by enter)

then press Ctrl-d and the command touch /root/thisworked will be executed at 06:20am today.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.