Search code examples
linuxshellrsync

Rsync'ing only newer files and folders


I need to set up a cronjob on linux shell which is doing a backup of recently changed files and folders. This line is working fine:

 find /daten/ -mtime -7 -type f -print0 | rsync -0ve "ssh -i /root/.ssh/bak" --delete-after --files-from=- /daten/ [email protected]:/users/bak

For an additional network-internal backup this modified line is throwing an error 'rsync: link_stat "/daten/daten/[...]" failed: No such file or directory (2)':

find /daten/ -mtime -30 -type f -print0 | rsync -0v --delete-after --port=19002 --files-from=- /daten/ 192.168.0.99::grafic

The module grafic is correct and testet.

Why is rsync looking for "/daten/daten[...]" instead of "/daten/[...]" like the first working codeline?

What could be the problem here?

Thanks!


Solution

  • Here's the working codeline:

    find /daten -mtime -30 -type f -print0 | rsync -0v --delete-after --port=19002 --files-from=- --from0 / 192.168.0.99::grafic