Cron scheduled backups still not running

I originally posted this in April, and the topic closed and never really got resolved.

I have a scheduled cron backup job from my Webmin NAS to my adjacent Synology NAS. The problem is, it’s not running as scheduled. I can run it manually, and the backup will work fine, but we all know it’s far better to have backups running automatically.

I have the cron job scheduled to run daily at midnight, as you can see in the attached screenshot. But it’s not actually running, and I’m not sure what I need to change.

SYSTEM INFORMATION
OS type and version Debian 11
Webmin version 2.202

On rocky there is a cron log, not sure what Debian does, maybe find the log file for cron and see if its trying to run.
Are other crons working ok?

Minutes and hours should not be set to all.

1 Like

they are not set the OP is using a ‘simple’ schedule so those select boxes have no effect

1 Like

@popmay is right.This will cause the cron to run every minute on every hour. This will cause the backup cron to keep running and maybe even starting a new cron instance even before the last one has finished.

You should only use the All option on days so the cron is run every day etc…

@jimr1 I see what you mean, and you are right that the advanced options below will be ignored.

Just a thought, it may be that in the cron enviroment your path maybe different to what your user at the terminal gets hence it runs in the terminal but not as a cron job. It may be worth using the full path to rsync (you can find that using which rsync in a terminal) or copy your user PATH to a cron enviroment variable

1 Like

You will really have to ELI5 with me. This is a basic (old) home NAS operated by a single person (me) who is even struggling to make that basic functionality work. I just want it to backup daily at midnight to my other NAS. That simple.

I noticed when I flipped them from All to Selected while maintaining the Simple Schedule, after I save, they flip right back to All.

you obviously don’t read the posts

Well, I know the simple schedule SHOULD override the other options. But I don’t know if it actually DOES!

If it didn’t I wouldn’t have mentioned it in the first place

OK, so I flipped it back to Simple Schedule, Daily (at midnight). I also typed which rsync into a terminal and got /usr/bin/rsync so I updated the cron job accordingly. This is what I have now. Does that look right?

Run the cron job from the gui ‘save and run now’ and see if it works … as we can not see the full command there could be errors there, the email address associated with the cron job should receive an email showing the output from the cron command but using ‘save and run now’ should display what errors are there, unless you have piped the output to null

There are no other crons for me. This is the only one.

This is supposed to be a very simple NAS setup for me just for storing my media (especially my extensive photography), so I’m not doing anything at all exotic.

That ran successfully when I clicked Save and Run Now, but I was able to do that before. Time will tell if it runs on its own every night.

Just learned that Rocky is a Linux distro. I am on Debian 11.

In step-by-step language, how do I check these cron logs? Which commands?

Still very much a noob here.

The way I checked before was literally looking at my Synology backup server and seeing if the newest file on my Linux server was there too the next day. (It wasn’t backing up when I posted this unless I ran the cron job manually.) I’m sure there is a better way.

I presume the service is enabled.

Presume NOTHING with me! I fully admit to having no idea what I’m doing when it comes to servers, Linux, etc. But I just checked Bootup and Shutdown and saw this. So, I THINK it’s enabled? If you are looking at a different screen in Webmin, could you please let me know where to find that screen?

Yes research how to use a linux environment and test stuff rigorously before you put it into production maybe run crontab -e from the command line to see what you have actually configured, then work out what’s failing

Do you understand what I’m doing with this box? It’s a basic home NAS in my living room, mostly for my hobby photography. Simple storage and running backups to the other NAS sitting next to it. I’m not running an enterprise or even a small business here. Not even a real homelab. I don’t have a test environment.

Install something like virtualbox and create a test environment then from working out whats wrong and fixing it move that to your (production i.e home) server. But I guess you know best