<div dir="ltr"><div><div>Hi Kevin,<br><br>Thank you very much for the response. Actually, I don't think I need to clean the backup dir defined in --backup-dir=<backup dir>, when the contents has already been deleted in the destination (no exist), it will delete from the backup dir as well in next cycle, correct?<br><br></div>Regards,<br><br></div>- j<br><div><div><div><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 4, 2016 at 12:39 PM, Kevin Korb <span dir="ltr"><<a href="mailto:kmk@sanitarium.net" target="_blank">kmk@sanitarium.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Obviously you can ssh an rm -rf.  Alternatively, if you are in a<br>
restricted environment where you are only allowed to use rsync you can<br>
rsync --delete an empty directory to it.<br>
<div><div><br>
On 02/03/2016 08:33 PM, jupiter wrote:<br>
> Hi,<br>
><br>
> I am runing rsync --backup --backup-dir=$BACKUPDIR where the<br>
> BACKUPDIR=$(date +%d) to recycle the $BACKUPDIR in a month. But<br>
> rsync does not clean the  $BACKUPDIR before writing to it in<br>
> cycling.<br>
><br>
> I guess you have to clean it manually before the rsync can write to<br>
> it. As my $BACKUPDIR is in remote machine, do you have to run ssh<br>
> to delete it first before calling rsync in a script? Or if there is<br>
> better parameter in rsync to automatically delete the old<br>
> $BACKUPDIR, and create a new one?<br>
><br>
> Thank you.<br>
><br>
> - j<br>
><br>
><br>
<br>
</div></div>- --<br>
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,<br>
        Kevin Korb                      Phone:    <a href="tel:%28407%29%20252-6853" value="+14072526853" target="_blank">(407) 252-6853</a><br>
        Systems Administrator           Internet:<br>
        FutureQuest, Inc.               Kevin@FutureQuest.net  (work)<br>
        Orlando, Florida                <a href="mailto:kmk@sanitarium.net" target="_blank">kmk@sanitarium.net</a> (personal)<br>
        Web page:                       <a href="http://www.sanitarium.net/" rel="noreferrer" target="_blank">http://www.sanitarium.net/</a><br>
        PGP public key available on web site.<br>
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2<br>
<br>
iEYEARECAAYFAlayq9kACgkQVKC1jlbQAQenqQCggRskPs3HgH9Xp4vB1e+1I38d<br>
kC4AoIih2r6jd0RqKGByLncVbfVHXLUQ<br>
=O0W8<br>
-----END PGP SIGNATURE-----<br>
<span><font color="#888888"><br>
--<br>
Please use reply-all for most replies to avoid omitting the mailing list.<br>
To unsubscribe or change options: <a href="https://lists.samba.org/mailman/listinfo/rsync" rel="noreferrer" target="_blank">https://lists.samba.org/mailman/listinfo/rsync</a><br>
Before posting, read: <a href="http://www.catb.org/~esr/faqs/smart-questions.html" rel="noreferrer" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a><br>
</font></span></blockquote></div><br></div></div></div></div></div></div></div>