[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: rsync backup



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

Attachment: pgpmcKgeGWt5v.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]