When I get some time, maybe I will look into adding times that the cron jobs run.
That would be awesome!
When I get some time, maybe I will look into adding times that the cron jobs run.
That would be awesome!
Did you turn off the anacron job in cron.d?? Anacron is actually started by cron.
Hi,
Well, as I don´t know for sure where to find it, I browsed a little bit in cron.d and found the anacron file.
It says:
30 7 * * * root test -x /etc/init.d/anacron && /usr/sbin/invoke-rc.d anacron start >/dev/null
If I understand cron syntax right It starts anacron at 7:30 every day. But most of the time the NAS will be turned off at 7:30. So anacron does not start.
I could write */20 * * * * , so anacron would be started every 20 minutes. Would this be ok?
Thanks in advance for your answer!
Pretty sure you only want to run anacron once per day. Might duplicate jobs if you run it more than once per day. I would pick a time when you know the system will be on. If there is no specific time it will be on, then schedule a time for it to be on and then shut it down.
I feared that this could be the effect, if I start it e.g. every 20 minutes.
But I don´t understand the advantage of scheduled tasks, if anacron only starts at a specified time. Then I could also use cron. Shouldn´t it always start, when the NAS starts?
Yesterday, shortly after I started the NAS, I got an email from Anacron which said:
Anacron job 'cron.weekly' on nas [nas.XXX.XXX]
/etc/cron.weekly/openmediavault-update-smart-drivedb:
Updating smartmontools 5.41 drive database ...
/usr/share/smartmontools/drivedb.h updated from branches/RELEASE_5_41_DRIVEDB
So anacron does work in a way, doesn´t it?
I´m sorry, but I´m pretty helpless right now.
What am I missing? I just want that the backups via rsnapshot are started automatically independent of specific times.
Yes, anacron is supposed to start whenever you turn your system on. That is why there is an "at boot" time. I don't know why your system wouldn't work. I do know the "at boot" task doesn't run instantly after turning your system on. So, maybe your system wasn't on long enough? Does your system turn on and off more than one time per day?
Usually not. When I need access to data on my NAS I start it and usually power it off before I go to bed or when I know that I won´t need it the rest of the day.
But I would not exclude the possibility that it starts more than one time per day.
I will let it run several hours now to see if something happens.
Where can I find the file where this "at boot" should be?
If you power it up more than once per day, it won't work with my idea of using /etc/rc.local. At boot is an option in scheduled tasks but that won't work either if you power up more than once per day.
There doesn't seem to be a good solution. So, I'm really not sure what to tell you other than set your system to turn on at 3:30am, run rsnapshot, and turn it back off.
My NAS ran almost 7 hours today, I started it at about 3:30pm or 15:30. I started it only one time today. But there was no backup done during this time.
If I understand you correctly, a backup should have actually started then.
A daily anacron task should have run. I assume it works when you test it?
Yes, the job works, when I manually start it from the scheduled jobs section on the GUI.
What is the output of: cat /etc/anacrontab
The output is:
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root
# These replace cron's entries
1 5 cron.daily run-parts --report /etc/cron.daily
7 10 cron.weekly run-parts --report /etc/cron.weekly
@monthly 15 cron.monthly run-parts --report /etc/cron.monthly
Not sure. You could try putting the line: /usr/sbin/anacron in your /etc/rc.local before the exit 0 line.
I´ll try it. Thank you for your help.
Hello,
well it did not work.
Do you have any other ideas? How can I check, if anacron is running?
The date it ran last will be in the files in /var/spool/anacron/
cat /var/spool/anacron/cron.daily
Well it says that it ran/runs today.
Maybe something in /etc/cron.daily/0anacron is failing?? What is the output of: ls -al /usr/sbin/anacron
-rwxr-xr-x 1 root root 34760 Mai 22 2012 /usr/sbin/anacron
That is correct. I'm out of ideas. I have no idea why it isn't working.
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!