<div dir="ltr">Hi,<div><br></div><div>I think the words used are not correct, that's why you (and Kevin) are a bit confused. You are in fact asking for "incremental" backup, not a "snapshot" : <a href="http://en.wikipedia.org/wiki/Snapshot_(computer_storage)">http://en.wikipedia.org/wiki/Snapshot_(computer_storage)</a>.</div>

<div>In this case, you can use rsync with a few flags to delete (or move in another directory) the modified/deleted files regarding the last "backup".</div><div><br></div><div>This would look something like this ((h)uman, do not (x)cross filesystem boundaries, (P)rogress, (H)ard-links, (a)rchive, aka recursive+symlinks+perms+time+owner+group+specials and g(z)ip):</div>

<div><br></div><div><div># Cloning your data to a distant folder with timestamp</div><div>rsync -hxPHaz --exclude=<exclude_list> <source> <target>/$NOW/</div><div><div># Incremental backup only</div></div>

<div>rsync -hxPHaz --exclude=<exclude_list> --delete --backup --backup-dir=<backup> <source> <target>/latest/<br></div></div><div><div># You can even "suffix" the modified/deleted files</div>

<div>rsync -hxPHaz --exclude=<exclude_list> --delete --backup --backup-dir=<backup> --suffix=~$NOW <source> <target>/latest/<br></div></div><div><br></div><div>Hope that will help,</div><div>Greg</div>

<div><br></div><div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 4, 2014 at 11:21 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"><div class="">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
</div>Yes, you have different scripts now at least.  But I still don't see<br>
any snapshotting.  The only difference in these is that the "full" one<br>
rsyncs to a date+time stamped directory while the "snapshot" one<br>
rsyncs to a directory named snapshot.  As far as I can tell both will<br>
be a complete copy with no relationship to the other.<br>
<div><div class="h5"><br>
On 09/04/2014 05:17 PM, Chris wrote:<br>
> On Thu, 2014-09-04 at 17:00 -0400, Kevin Korb wrote:<br>
>> Do you actually have any snapshots currently?  From the scripts<br>
>> you posted it seems to just be rsyncing to the same dir every run<br>
>> and only claiming to be making snapshots.  If you do have<br>
>> snapshots now then something else is happening in addition to<br>
>> this script.<br>
><br>
> It was pointed out to me in a direct message that I had<br>
> inadvertently posted the same scripts (full backup) in pastebin.<br>
> Here are the correct one.<br>
><br>
> Full <a href="http://pastebin.com/dEk7kBip" target="_blank">http://pastebin.com/dEk7kBip</a><br>
><br>
> Snapshot <a href="http://pastebin.com/H7SuABN1" target="_blank">http://pastebin.com/H7SuABN1</a><br>
><br>
>><br>
>> On 09/04/2014 04:58 PM, Chris wrote:<br>
>>> On Thu, 2014-09-04 at 12:46 -0400, Kevin Korb wrote:<br>
>>>> The scripts you posted look the same to me.  And I don't see<br>
>>>> any form of snapshotting.  The $NOW variable is set and is<br>
>>>> echoed but it is never actually used.  For an rsync snapshot<br>
>>>> I would expect to see either rsync --link-dest or a cp -al<br>
>>>> depending on the age of the script.<br>
>>>><br>
>>>> The only reason to need two scripts would be because the<br>
>>>> snapshot would need 3 dirs to work with (the source, the<br>
>>>> target, and the previous backup) but that could also be<br>
>>>> handled with 1 script and a simple existing check.<br>
>>>><br>
>>>> On 09/04/2014 12:30 PM, Chris wrote:<br>
>>>>> I have two scripts that a kind soul on this list wrote for<br>
>>>>> me over 4yrs ago. I got to looking at them the other day<br>
>>>>> because my old box crashed and had to build a new one also<br>
>>>>> got a new backup USB drive since I'm still copying over<br>
>>>>> things from the old one. The first one is for a full<br>
>>>>> backup:<br>
>>>>><br>
>>>>> <a href="http://pastebin.com/XF6Zm42A" target="_blank">http://pastebin.com/XF6Zm42A</a><br>
>>>>><br>
>>>>> Works great, does exactly what it's supposed to do. The<br>
>>>>> second is for a 'snapshot' which is where I get a bit<br>
>>>>> confused. I would think that a 'snapshot' would be just the<br>
>>>>> changed files either since the last full backup or since<br>
>>>>> the last 'snapshot' the night before. It seems though that<br>
>>>>> it's actually the same as a full backup. I don't profess to<br>
>>>>> be a script person so I have no idea if it's doing what it<br>
>>>>> should or something needs to be changed. Below is the 2nd<br>
>>>>> script:<br>
>>>>><br>
>>>>> <a href="http://pastebin.com/MkBzJnux" target="_blank">http://pastebin.com/MkBzJnux</a><br>
>>>>><br>
>>>>> Any advice would be appreciated.<br>
>>>>><br>
>>>>> Chris<br>
>>>>><br>
>>>><br>
>>> Thanks Kevin, I guess for now I'll leave them as they are until<br>
>>> I can get smart on scripting.<br>
>>><br>
>>> Chris<br>
>>><br>
>><br>
><br>
><br>
<br>
</div></div><div class="">- --<br>
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~<br>
        Kevin Korb                      Phone:    (407) 252-6853<br>
        Systems Administrator           Internet:<br>
        FutureQuest, Inc.               Kevin@FutureQuest.net  (work)<br>
        Orlando, Florida                <a href="mailto:kmk@sanitarium.net">kmk@sanitarium.net</a> (personal)<br>
        Web page:                       <a href="http://www.sanitarium.net/" 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>
</div>iEYEARECAAYFAlQI19QACgkQVKC1jlbQAQcn9QCfdyjYePz5IanuxcowLuRcBnIN<br>
tpcAoNRVEndI3F6+we8rSHASybAWd471<br>
=W5WZ<br>
-----END PGP SIGNATURE-----<br>
<div class="HOEnZb"><div class="h5">--<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" 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" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a><br>
</div></div></blockquote></div><br></div>