Deferred cron

I finally solved the problem I had with rsyncing over NFS. It was just to set up the regular key-based auth between the servers and use rsync across a ssh session. Since I did this at the working hours, I wanted to avoid pushing the backup now, when the people are still working. I also knew I will forget to put the con job into crontab if I won’t do it now, but since it’s purpose was to be run every ten minutes, I would not avoid running the job before long. Then I recalled the handy at tool, and came up with this simple usage:

[root@mail ~]# at 20:00
at> echo "*/10 * * * * root /root/scripts/backup-over-rsync.sh" >> /etc/crontab
at> <EOT>

The final <EOT> is the result of pressing ctrl+d.  Sad thing is you can not use shell completion inside the at prompt. Usually I just <tab> at will in another terminal window and copy&paste the result.

Tags: , ,