Thanks, sleep and at are what I was looking for.
For sleep, is there any way multiple commands per line can be executed in the background? For instance, the following gives the error:
Code:
# sleep 5 &; rm -f test.php &
-bash: syntax error near unexpected token `;'
Removing the '&' after sleep causes it to work, but then the sleep isn't in the background.
It took me a while to find the 'at' syntax, apparently you have to do one of the following for 'rm -f test.php':
Code:
# echo "rm -f test.php" | at HH:MM
OR: # at HH:MM -f filename
Where
filename contains the command "rm -f test.php".
Also for 'at', my atd daemon wasn't started; '/sbin/service atd status' said 'atd is stopped', and trying to use at gave the error 'Can't open /var/run/atd.pid to signal atd. No atd running?'. I had to start the atd daemon with:
Which I also added to /etc/rc.local so it would be done at startup. Would it be better to place this command in .bashrc instead of /etc/rc.local? Is there any reason to use one instead of the other - /etc/rc.local or .bashrc?