Archive jobs in Rsync

  • Hi


    I'm very new to OMV and Rsync and so would appreciate some advise on what can be achieved in terms of archiving (backup) data.


    My data is approx. 250GB on one drive, and I have a spare drive which is 1TB free.


    I'd like to set up a job that archives my data, I imagine it would:


    1. ZIP the 250GB, of data (to save space and package it up)

    2. Move the zipped data onto the 1TB drive marked with the date and give the zip file name todays date


    This would run every month.


    It would also need to check that if there is enough space on the 1TB drive, if not it would delete the oldest archive.


    Essentially, it would allow me to have 3 to 4 months of backups on the drive.


    Is this possible?


    Thanks.

    • Offizieller Beitrag

    If you want to have exactly what you are describing you would have to write your own script.


    BUT I think you can achieve your target quite easily in different ways. If you run a versioned backup, you don't need a full backup every time. The first backup is full, but on subsequent backups you only need new and changed files.


    This can be achieved with rsnapshot. It uses hardlinks to link data that have not changed to the original file. It does not compress/package the files, so you can access the backup any time without extracting the files.


    Another way is borgbackup. It uses compression and encryption.


    You could run those jobs hourly, daily, weekly or whatever you want. For both options plugins are available.

  • OK, thanks, two questions:


    - To write my own script - would that be a Bash script?


    - Instead of compressing the archive data, it is possible in OMV to compress the whole drive (like you can in Windows)


    Thanks,

    • Offizieller Beitrag

    - To write my own script - would that be a Bash script?

    Yes. Would be the simplest.

    - Instead of compressing the archive data, it is possible in OMV to compress the whole drive (like you can in Windows)

    Yes, if you use btrfs or zfs. Not sure for other filesystems. But note that most media files like movies and pictures will not benefit from compression as they are most likely stored in a compressed format. And media files usually occupy the bigger part of the drive.


    Please consider also, that making several full backups of the same data on the same drive is quite some waste.

    • Offizieller Beitrag

    Any reason why you don't want to use rsnapshot? With that you could have probably hundreds of snapshots of your data. Depends on how often they change.

    Rsnapshot produces incremental backups, but each snapshot in itself is complete as all data are inside, just most of them are hardlinked to the data from previous snapshots if they have not changed.

  • I run a scheduled task


    zip -r -FSr "/THE/FOLDER/TO/BACKUPDRIVE/FILENAME-$(date +"%d-%m-%Y").zip" "/BACKUPFOLDER/" && ls -1t "/THE/FOLDER/TO/BACKUPDRIV/"* -tp | grep -v '/$' | tail -n +6 | xargs -I {} rm -- {}


    Ok there no check for available space, but this should create the file name with date, then keeps the latest 5 files, any older is deleted


    It does mean one type of backup per folder and no other files. you probs could add a filter on file name etc

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!