Template:egSyncOldFiles

From RaySoft

Syntax

{{egSyncOldFiles}}

Usage

Code

{{egSyncOldFiles}}

Result

Only sync files which are older than 30 days
[[ -d "${bkp_path}" ]] || mkdir -p "${bkp_path}"

find "${src_path}" -type 'f' -mtime '+30' -print0 \
| sed --null-data "s|${src_path%/*}/||" \
| rsync --archive --from0 --files-from=- --verbose "${src_path%/*}" "${bkp_path}"