Koozali.org: home of the SME Server

No backup at weekends

Matt Quelch

No backup at weekends
« on: July 08, 2003, 02:26:39 PM »
Hi,

I have used the Backup-To-A-Share how-to, and it is all working very nicely. Except one annoying grope I have. My PCs are swithced off at weekends, but the server still tries to backup, but as it cannot mount the network share, it ends up backing up to the server. Which wouldn'be be a problem but for the fact that I am running a little low on disk space. Does anyone have any suggestions on how to stop the backup at weekends? I imagine there may be some way of stopping cron maybe? Or possibly writing into the backup script, "If the Network Share isn't accessible then abort the backup" or something along those lines?

If anyone has managed this I'd sure appreciate a pointer!

TIA
Matt

Kelvin

Re: No backup at weekends
« Reply #1 on: July 09, 2003, 04:58:30 AM »
Hi Matt,

The backup process is fired up from the file /etc/cron.d/backup

You could create a custom template for the /etc/cron.d/backup file :-

mkdir -p /etc/e-smith/templates-custom/etc/cron.d
cp /etc/e-smith/templates/etc/cron.d/backup /etc/e-smith/templates-custom/etc/cron.d

then modify the backup entry :-
pico /etc/e-smith/templates-custom/etc/cron.d/backup

About the 8th line from the end of the file (on my SME 5.6),

."$backupMin $backupHour * * * root"

Change the last " * " to the days you want backup to run :-
Eg. to run only Monday to Fridays,

."$backupMin $backupHour * * 1-5 root"

Save the file, and expand the template.

/sbin/e-smith/expand-template /etc/cron.d

I can't remember exactly, you may or may not need to "touch" crontab in order for the cron daemon to reload the cron table entries. If you have to, type :-

touch /etc/crontab

If not, don't worry about it. Even if you did do the touch command, it would not harm anything.

Hope this helps.

Kelvin

Matt Quelch

Re: No backup at weekends
« Reply #2 on: July 09, 2003, 01:58:45 PM »
Fantastic, thanks for that Kelvin, looks good, just gotta wait for the weekend now!

Matt