Koozali.org: home of the SME Server

How do you change the backup schedule in flexbackup?

MJB

How do you change the backup schedule in flexbackup?
« on: December 14, 2006, 07:48:48 PM »
I have a simple question with a not-so-obvious answer: How do you change the backup schedule in flexbackup? By default, it runs a full backup every night. I want to change the schedule so it runs the backup only on Friday. Not putting a tape in the drive will take care of Monday through Thursday, but the system will run a full backup on Friday, Saturday, and Sunday.

After a little digging, I found the backup entry in /etc/crontab, and it would be easy to change. However, this file contains the standard warning:

!!DO NOT MODIFY THIS FILE!!
Manual changes will be lost when this file is regenerated.


Where do you make this change so it becomes part of the system config?

Offline pfloor

  • *****
  • 889
  • +1/-0
How do you change the backup schedule in flexbackup?
« Reply #1 on: December 14, 2006, 09:21:34 PM »
First you need to read this portion of the "Development Guide" to understand how the template system works and how to create "custom-templates"

http://mirror.contribs.org/smeserver/contribs//gordonr/devguide/html/devguide.html#TEMPLATES

Then copy the standard template /etc/e-smith/templates/etc/crontab/backup to:
/etc/e-smith/templates-custom/etc/crontab/

Then edit the custom template to suit your needs.

Then you must expand the template so it writes your changes to /etc/crontab like this:

expand-template /etc/crontab
In life, you must either "Push, Pull or Get out of the way!"

MJB

How do you change the backup schedule in flexbackup?
« Reply #2 on: December 15, 2006, 05:10:28 PM »
Thank you for the information. That was an easy change to make, once I knew where to do it.

Offline matheson

  • *
  • 15
  • +0/-0
How do you change the backup schedule in flexbackup?
« Reply #3 on: December 19, 2006, 07:22:25 AM »
I am also interested in making a backup once a week, so I followed this topic with great interest. However I get lost, when editing the backup template.

Do I need to add $backupDay, and than it should apple to configure in server-manger after a reboot ?

Thanks for input

Ian

MJB

How do you change the backup schedule in flexbackup?
« Reply #4 on: December 19, 2006, 04:03:36 PM »
Let me explain the whole process step-by-step:

1. Login on the server console as root.

2. If the custom template's directory does not exist, create it.

mkdir -p /etc/e-smith/templates-custom/etc/crontab

3. Copy the standard backup template to the custom template directory.

cp /etc/e-smith/templates/etc/crontab/backup /etc/e-smith/templates-custom/etc/crontab

4. Edit the custom backup template. The lines to be changed are located at the bottom of the file. crontab identifies the days of the week as 0 - 6, where 0 is Sunday and 6 is Saturday. In this example, I am changing the reminder and backup days to Friday (5).

vi /etc/e-smith/templates-custom/etc/crontab/backup

Change "$reminderMin $reminderHour * * * root" to "$reminderMin $reminderHour * * 5 root"
Change "$backupMin $backupHour * * * root" to "$backupMin $backupHour * * 5 root"

Save the file.

5. Expand the template to make it apply the changes to the crontab file.

expand-template /etc/crontab

To verify that the changes were made, display the crontab file and look for the backup lines near the bottom.

cat /etc/crontab

These changes take effect immediately. You do not have to reboot the server.

Offline matheson

  • *
  • 15
  • +0/-0
How do you change the backup schedule in flexbackup?
« Reply #5 on: December 19, 2006, 06:40:39 PM »
Great - Thanks for the easy-understanding reply. /etc/crontab now is corrected.

There is a lot more I have to learn. I did not know that the stars was for indicating running in minutes, hour, days or months.