Saturday, October 29, 2005

Server Backup - Programming One Liner 2

Server directory backup


cd /user/backups; ls -1 /oldb2/home/virtual/ | grep site | grep -v '-' | while read i; do bkdir=/oldb2/home/virtual/$i; echo $i; echo $bkdir; tar -cf $i-www.tar $bkdir/fst/var/www; echo "Gunzip $i"; gzip $i-www.tar; ls -l $i-www.tar.gz; done


This programming one liner allows you to backup directories. First it makes a tarball of a directory and then uses gzip to compress the tarballs.


Programming "One Liner" lookup terms:
ls, grep, tar, ls, gzip

USE THIS PROGRAMMING ONE LINER AT OWN RISK AS AUTHOR CLAIMS NO RESPONSIBILITY.
If you would like more information on any of the commands, please feel free to contact me with your . For even more information on this one liner programming code, lookup the programming terms displayed above, visit my Linux and network security blog, external programming blogs on Technorati, or programming blogs on Google.

No comments: