0

I have hyperbackup running from source NAS to destination NAS with the below settings

  1. Backup type - Rsync
  2. Options - reserve backup file at destination
  3. With this i have a backup method that results in a file/fodler structure in the 2nd NAS, withut the hyperbackup proprietary format or tools

I have the below cronjob on source NAS via task schedule which deletes files on the destination NAS which are not present in source NAS.

rsync -avh --delete /path/to/source user@wan_ip:/path/to/destination

I want to modify the cron job so that it deletes files from destination which are not present on source and 1 week old. something like:

rsync -avh --delete(1 week old) /path/to/source user@wan_ip:/path/to/destination

Is there a way to do this?

The source and destination NAS both have multiple folders on which this Job has to run.

Paul
  • 2,755
  • 6
  • 24
  • 35

1 Answers1

0

I don't see any options for rsync that would do this per se, but you could try a two step approach.

You can add the -b parameter too your rsync call, which would cause it to rename the files with a backup extension instead of deleting them.
Then you could run a find afterwards that looks for backup files older than 1 week and deletes them.

Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79