1833730 Members
2381 Online
110063 Solutions
New Discussion

Re: at command

 
SOLVED
Go to solution
Tarek
Super Advisor

at command

Hallo, i have to program a reboot tomorrow morning at 6 a.m. I want to use at command, but i'm not sure on how using it. I saw the man but it isn't very clear...can u help me??
thanks
10 REPLIES 10
Vincenzo Restuccia
Honored Contributor

Re: at command

Run a job contained in future in the home directory at 12:20 a.m. on December 27, 2013:

at -f $HOME/future -t201312271220.00



Run a job contained in jobfile in the home directory at 5:00 a.m. next Tuesday:

at -f $HOME/jobfile 5am tuesday next week



Run the same job at 5:00 a.m. one week from next Tuesday (i.e., 2 Tuesdays in advance):

at -f $HOME/jobfile 5am tuesday + 2 weeks

Tarek
Super Advisor

Re: at command

i have to program a reboot, i don't want to run a job file.
Is this syntax right??
at -t 03280600 shutdown -r -y now
Tarek
Super Advisor

Re: at command

i have to program a reboot, i don't want to run a job file.
Is this syntax right??
at -t 03280600 shutdown -r -y now
Tarek
Super Advisor

Re: at command

i have to program a reboot, i don't want to run a job file.
Is this syntax right??
at -t 03280600 shutdown -r -y now
Pedro Sousa
Honored Contributor
Solution

Re: at command

1 - create the script with the command shutdown/reboot.
2 - Run the following command: "at -f <script> -t 03280600"

Don't forget to mencion all the path in the field <script>
This will reboot your system at 6 a.m.

good luck.
Mark Vollmers
Esteemed Contributor

Re: at command

You should be able to just enter "at -t 03280600 reboot". I don't think can put the date and time and then the now command as well; it's one or the other.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Steven Sim Kok Leong
Honored Contributor

Re: at command

Hi,

Please note that the "at" command launches the command from the current directory you execute the "at" command. If you are executing the shutdown command, please note that shutdown can only be run from the / directory.

To verify, access your "at" scheduled job in /var/spool/cron/atjobs and look out for the "cd " portion of the script.

Thus, you should either run the "at" command at /, or write a script that "cd /" before shutdown.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Bill Hassell
Honored Contributor

Re: at command

Be careful with the reboot command. It's great when you are in single user mode with no users and processes running. But it is very unkind to processes that buffer large amounts of data which needs to be flushed.

shutdown goes though all the start/stop scripts in a controlled order and signals all processes to terminate normally, giving them time to come to a normal end of job.


Bill Hassell, sysadmin
Satish Y
Trusted Contributor

Re: at command

many ways,

Take root and execute
# at 6:00am tomorrow reboot

place shutdown/reboot command in a file. suppose today is March 27th u can also execute

# at -f 6:00am Mar 28
or
# at -f 0600 Mar 28
or
# at -f -t 03280600

u can execute whatever way in above u want...

Cheers...
Satish.
Difference between good and the best is only a little effort
Thierry Poels_1
Honored Contributor

Re: at command

maybe to late for your problem, buy anyway:

why don't you put the shutdown command in the crontab. You'll need to remove it again from your crontab afterwards but anyway (to avoid rebooting next day, next year, ...)

As stated before you should use "shutdown -r" instead of "reboot".

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.