Submitted by root
I find rcs useful for this - as it lets you edit files in place, keeping the history in x.org,v for the file x.org.
It doesn't require a repository so it is very lightweight - plus it will allow you to easily see the differences between versions, something which is commonly useful on configuration files and hard to achieve with dated-backup files.
# Save a copy of any file in /etc that has been changed.
# To be run daily from via cron
#ert -x # Trace
#set -e # Exit on error
/usr/bin/test -d $DESTDIR || mkdir -p -m755 $DESTDIR
for file in `/usr/bin/find $SRCDIR \( -type f -o -type l \)`; do
# Exceptions. Do not backup
case $file in
*~) /bin/rm $file; continue;;
*bak|*.dpkg*|*.old) echo "Check $file"; continue;;
# do nothing if file is empty
test -s $file || continue
if [ -e ./$file ]; then
/usr/bin/cmp -s $file ./$file && continue
/usr/bin/savelog -p -c $CYCLES ./$file >/dev/null
test -d ./$dir || mkdir -p ./$dir
/bin/cp -dp $file ./$file
Your version control software of choice is
( 851 votes ~ 9 comments )
View Prior Polls
Articles and comments are the property of their respective posters.
Trademarks are the property of their respective owners. Debian is a registered trademark of Software in the Public Interest, Inc.
This site is copyright © 2004-2013 Steve Kemp.Site hosting provided by Bytemark Hosting on the BigV platform.
Article Feeds in Atom, RSS, & RDF formats