Re: Incrementally backup ONLY deleted / changed / new files - SOLVED

Philip Rhoades via rsync <[email protected]>
Newsgroups gmane.network.rsync.general
Message-ID <[email protected]>
People,


On 2023-04-16 18:06, Philip Rhoades via rsync wrote:
> People,
> 
> I have command for backing up to a backup dir (eg /home/backup/prix/) 
> with:
> 
>   rsync -av --delete --link-dest /home/backup/prix/${1}_0_hard_link
> /$1/ /home/backup/prix/${1}_$dt/
> 
> for example the etc dir - which creates the following in the backup 
> dir:
> 
>   etc
>   etc_0_hard_link
>   etc_20230416_165232
> 
> - having previously created a hard-linked clone of the previously
> existing backup eg:
> 
>   cp -al /home/backup/prix/etc /home/backup/prix/etc_hard_link
> 
> However, in the backed up dirs with the date-time extension, ALL the
> files from etc are copied - how do I rsync ONLY the deleted / changed
> / new files?


After much Googling, I found this did what want:


#!/bin/bash

if test $# != 3
     then echo "Usage: rsync_inc.sh full_path_source_dir 
full_path_comp_dest_dir full_path_diff_dir"
     exit
fi

dt=`dt_Ymd_HMS.sh`

rsync -rcC --compare-dest=$2/ $1/ ${3}_$dt/


P.
-- 
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  [email protected]

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.