Koozali.org: home of the SME Server

Workstation backup config

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Workstation backup config
« on: July 17, 2016, 08:26:41 AM »
I have configured the workstation backup on sme server. Once in a 14 days, it runs full backup. I have configured 1set of backup(a nas drive).
I want to know when the full backup runs, the old backup is being deleted before the full backup run? Or after the full backup is been done?

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Workstation backup config
« Reply #1 on: July 17, 2016, 12:13:55 PM »
After

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Re: Workstation backup config
« Reply #2 on: July 17, 2016, 02:23:59 PM »
Is there any option to make it delete before the backup begins?

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Workstation backup config
« Reply #3 on: July 17, 2016, 02:58:11 PM »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Re: Workstation backup config
« Reply #4 on: July 19, 2016, 08:26:42 AM »
Thanks very much janet. Can i set a cron job to delete the old backup once a two week?

Offline Jean-Philippe Pialasse

  • *
  • 2,765
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Workstation backup config
« Reply #5 on: July 19, 2016, 08:54:18 AM »
this will higly depends on how you set your backup frequency. ( every 14 days, or every nth and mth day of the month.)
( I am not familiar with the workstation backup.)


the idea basically would be either to divide the * corresponding to the day of the month in the cron syntax by something occurring only twice a month and just before the new backup

this should be something between 11 and 14 (because of February , otherwise you will miss one, and if lower you will run three time per month)

Code: [Select]
+-----------------------Minute            (0-59)
|    +-------------------Hour of Day      (0-23)
|    |    +---------------Day of Month    (1-31)
|    |    |    +-----------Month of Year  (1-12)
|    |    |    |    +-------Day of Week   (0=Sun,6=Sat)
 
50   1    */12    *    6    root   . /opt/scripts/deletebkp1

if you did fixed day, then you could do for 1st and 15th days

Code: [Select]
+-----------------------Minute            (0-59)
|    +-------------------Hour of Day      (0-23)
|    |    +---------------Day of Month    (1-31)
|    |    |    +-----------Month of Year  (1-12)
|    |    |    |    +-------Day of Week   (0=Sun,6=Sat)
 
50   1    1    *    6    root   . /opt/scripts/deletebkp1
50   1    15    *    6    root   . /opt/scripts/deletebkp1

alternatively, maybe this script could be run as prebackup event, you would just need to put a link in /etc/e-smith/events/pre-backup/S06mylinktoDeletebkp1 (the heading S06 will allow to trigger it at the very beginning of the event).
As far as I remember this event is also triggered before the workstation backup

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Re: Workstation backup config
« Reply #6 on: July 19, 2016, 11:49:57 AM »
can this be triggered before only the full backup?

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Workstation backup config
« Reply #7 on: July 19, 2016, 12:06:56 PM »
you have to add a custom action into the pre-backup event..

anyway, you'd really explain your problem, not your solution

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Re: Workstation backup config
« Reply #8 on: July 19, 2016, 12:33:03 PM »
the problem is i want to delete the destination data before the full backup runs. Because the destination run out of free space. I have set the workstation backup for once a two weeks. (Number of rotating backup sets 1, Daily backups in each set 14) I have no enough space to run the full backup. that's the problem. if i run a cron job to delete the destination contents on 14th day before the full backup runs, it would be big help to me.

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Workstation backup config
« Reply #9 on: July 19, 2016, 12:59:50 PM »
IMO this is the wrong approach.. deleting your full backup before creating a new full one will be a big issue if the new full backup fails.. (Murphy's law docet)
IMO you have to rethink your backup strategy

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Re: Workstation backup config
« Reply #10 on: July 19, 2016, 01:09:04 PM »
yes i have thought about it. Before deleting the full backup, I am planned to backup the data to a USB hard disk. the backup remains until the next full backup takes place.

Offline Jean-Philippe Pialasse

  • *
  • 2,765
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Workstation backup config
« Reply #11 on: July 19, 2016, 02:58:22 PM »
as I told as third solution :

alternatively, maybe this script could be run as prebackup event, you would just need to put a link in /etc/e-smith/events/pre-backup/S06mylinktoDeletebkp1 (the heading S06 will allow to trigger it at the very beginning of the event).
As far as I remember this event is also triggered before the workstation backup

this is exactly what you ask, before your backup there is this event that is triggered, it will delete your backup as planned.


IMHO, and to second Stefano, if you have only one full backup on the destination drive, this is not a good solution to delete before creating the new one. If you are really tight in term of space and you can not buy an extra drive, I suggest using another method based on rsync such as backuppc. You will allways keep a full backup, and it will just transfer and update it  and delete what need to be deleted after, during or before depending on the options you choose

 

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Re: Workstation backup config
« Reply #12 on: July 19, 2016, 04:20:41 PM »
you have to add a custom action into the pre-backup event..

anyway, you'd really explain your problem, not your solution

Ok. My queation is I want to delete automatically the fully backup data from the backup destination before the next backup circle runs. if pre-backup event can run once a two week or only before the full backup runs, this could be a help for me.

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Workstation backup config
« Reply #13 on: July 19, 2016, 04:36:26 PM »
the pre-backup event runs everytime you run a backup, i.e. every day

you've been told how to do what you want to do and that what you are trying to do is dangerous.. we can't help you more

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Re: Workstation backup config
« Reply #14 on: July 19, 2016, 04:46:40 PM »
Ok I understand. But as Jean-Philippe Pialasse says about rsync the data to USB HDD from the NAS. The problem of that process is the USB drive is not in the work area because of ISO policy of data security. The USB Hdd can be used only on the backup day. I can change that backup day to the last incremental backup day of the workstation backup. Then no data is loosing when the full backup runs. that's why i am asking questions.

Offline Jean-Philippe Pialasse

  • *
  • 2,765
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Workstation backup config
« Reply #15 on: July 19, 2016, 07:44:10 PM »
Stefano was not really meaning litteraly every day for the pre-backup event, i am pretty sure he was meaning every time you run a backup!

So you do not have to worry on how to plan it, it will run automaticly anyway BEFORE, the actual backup start.. The only thing i am worry about is the actual time it could take to delete the backup...


My suggestion of rsync was rather to avoid to deal with a backup of the backup on a usb disk before deleteting it from the nas  to put another backup...

If you are worry by the size Available for a new archive of backup, then you should considere a new strategy :
- buy bigger disks for your nas, or
- use rsync to avoid to have to deal with a complete set of copy of all the file and the need for twice the space for the backup. Rsync will simply update the old backup in place.