Re: rsync backup

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

 



Luciano Rocha wrote:
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.

Got it! And very smart! Why not have a protection from accidental deletion. After all a unix delete is a real delete!



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




--

	Karl F. Larsen, AKA K5DI
	Linux User
	#450462   http://counter.li.org.

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux