Anacron - instaead of cron setup
by alex4buba from LinuxQuestions.org on (#57W4J)
I am now with KDE-Plasma 20.04 and being a Desktop machine, it is not always ON, so at times, my Cron job is not executing.
So, following suggestion here in the forum, I am trying to setup a Anacron job instead.
My cron job is looking like the following script. Once a day, at a selected time (18:00) it needs to run and perform a backup of my local folders into an external hard disk, each day into a designated folder - sun,mon,tue etc...
Code:00 18 * * 0 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/sun/
00 18 * * 1 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/mon/
00 18 * * 2 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/tue/
00 18 * * 3 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/wed/
00 18 * * 4 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/thu/
00 18 * * 5 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/fri/
00 18 * * 6 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/sat/My first attempt with anacron is the following:
Code:1 10 friday-job /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/fri/But,
1) When I tried to run in terminal the command : sudo anacrontab -e , there is no such command
2) So, how do I actually create an anacron job?
3) Is my command above correct for anacron?
4) Do I need to create 7 anacron jobs, one for each day, or can I somehow execute ONE single anacron job and point it to the above cron job?
Thanks to any helper
Alex


So, following suggestion here in the forum, I am trying to setup a Anacron job instead.
My cron job is looking like the following script. Once a day, at a selected time (18:00) it needs to run and perform a backup of my local folders into an external hard disk, each day into a designated folder - sun,mon,tue etc...
Code:00 18 * * 0 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/sun/
00 18 * * 1 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/mon/
00 18 * * 2 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/tue/
00 18 * * 3 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/wed/
00 18 * * 4 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/thu/
00 18 * * 5 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/fri/
00 18 * * 6 /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/sat/My first attempt with anacron is the following:
Code:1 10 friday-job /usr/bin/rsync -r /home/alex/afolders/ /media/alex/Elements/fri/But,
1) When I tried to run in terminal the command : sudo anacrontab -e , there is no such command
2) So, how do I actually create an anacron job?
3) Is my command above correct for anacron?
4) Do I need to create 7 anacron jobs, one for each day, or can I somehow execute ONE single anacron job and point it to the above cron job?
Thanks to any helper
Alex