Koozali.org: home of the SME Server
Obsolete Releases => SME 9.x Contribs => Topic started by: smnirosh 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?
-
After
-
Is there any option to make it delete before the backup begins?
-
Is there any option to make it delete before the backup begins?
https://wiki.contribs.org/Backup_with_dar#Backup_disk_size_limits_workaround
-
Thanks very much janet. Can i set a cron job to delete the old backup once a two week?
-
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)
+-----------------------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
+-----------------------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
-
can this be triggered before only the full backup?
-
you have to add a custom action into the pre-backup event..
anyway, you'd really explain your problem, not your solution
-
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.
-
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
-
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.
-
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
-
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.
-
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
-
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.
-
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.