rsync backup
Luciano Rocha
strange at nsk.no-ip.org
Tue Aug 7 11:24:55 UTC 2007
On Tue, Aug 07, 2007 at 05:13:11AM -0600, Karl Larsen wrote:
> I am interested in why you keep the last 15 incremental
> backups in files away from the main backup.
Why or how? If "why", because I may only notice that I deleted an
important file or e-mail after a few days. With the backup, I can still
access them.
If "how", I iterate over the contents of the directory and keep
variables with the number of entries in the directory and the argument
to rsync with the link-dest option:
for d in `ls $host/`; do
if [ $count -gt 15 ]; then
## remove if more than 15
rm -fr $host/$d
elif [ $count -le 2 ]; then
## add to link-dest if lower/eq than 2
link="--link-dest=$PWD/$host/$d $link"
fi
((count--))
done
--
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20070807/6675a85d/attachment-0001.sig>
More information about the fedora-list
mailing list