Is there a parameter in rsync to clean $BACKUPDIR before writing to it (--backup-dir=$BACKUPDIR)?
kmk at sanitarium.net
Thu Feb 4 01:39:38 UTC 2016
-----BEGIN PGP SIGNED MESSAGE-----
Obviously you can ssh an rm -rf. Alternatively, if you are in a
restricted environment where you are only allowed to use rsync you can
rsync --delete an empty directory to it.
On 02/03/2016 08:33 PM, jupiter wrote:
> I am runing rsync --backup --backup-dir=$BACKUPDIR where the
> BACKUPDIR=$(date +%d) to recycle the $BACKUPDIR in a month. But
> rsync does not clean the $BACKUPDIR before writing to it in
> I guess you have to clean it manually before the rsync can write to
> it. As my $BACKUPDIR is in remote machine, do you have to run ssh
> to delete it first before calling rsync in a script? Or if there is
> better parameter in rsync to automatically delete the old
> $BACKUPDIR, and create a new one?
> Thank you.
> - j
Kevin Korb Phone: (407) 252-6853
Systems Administrator Internet:
FutureQuest, Inc. Kevin at FutureQuest.net (work)
Orlando, Florida kmk at sanitarium.net (personal)
Web page: http://www.sanitarium.net/
PGP public key available on web site.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-----END PGP SIGNATURE-----
More information about the rsync