|
Disclaimer:
These pages about different languages / apis / best practices were mostly jotted down quckily and rarely corrected afterwards. The languages / apis / best practices may have changed over time (e.g. the facebook api being a prime example), so what was documented as a good way to do something at the time might be outdated when you read it (some pages here are over 15 years old). Just as a reminder. How to backup the CVS repositoryShell scripts to create backups easilyAs always, your own your own if the script mess your files up, I just provide the info you are responsible for what you do with it
Any feedback is highly appreciated, you can contact me at this email adress:
1 Backup of CVSBelow is a script I use to make a backup of the part of the CVS that I use.The CVS server we had at my company was not backed up regularly(!), so this was my paranoia to make sure that my stuff would not get lost.
Note that you must use pax if you need to extract the tars.
2 Source code#!/bin/ksh # # More scripts and tips can be found at # https://www.edlin.org/sitemap.html # # Script to generate BACKUPS of a part of the CVS repository (dilbert is the cvs server) # _ftp_file() { stty -echo read -r PASSWORD?"Enter password for user $2 : " stty echo print #$1 = server #$2 = userid #$3 = source #$4 = targetdirectory #extract filename filename="`expr "//$3" : '.*/\([^/]*\)'`" ftp -in $1 <<EOF user $2 $PASSWORD bin get $3 $4${filename} quit EOF } echo "Script to generate BACKUPS of a part of the CVS repository" echo "----------------------------------------------------------" echo "This script will make a tarfile of the files at dilbert:/cvs/data/theFiles" echo "it will save the tar-file in the directory \"bkps\", so make sure that directory exists" echo "NOTE: The files are stored with ABSOLUTE paths in the tarfile, so you need" echo "to use pax to extract the files somewhere else" filename="cvs_theFilesbackup_`date +"%Y_%m_%d_%H%M"`.tar" echo "Logging in to server to create the tarfile..." #Note: you might need to login as soem other user to be able to read the data in /cvs/data/ #it depends on how your cvs is set up rexec dilbert -l ${USER} "tar cf /tmp/${filename} /cvs/data/theFiles" echo "FTP the tar file over to this server..." _ftp_file "dilbert" "${USER}" "/tmp/${filename}" "/home/${USER}/bkps/" echo "Logging in to server to delete the tarfile..." rexec dilbert -l ${USER} "rm /tmp/${filename}" gzip /home/${USER}/bkps/${filename} More programming related pages |
|