Here is a script which I used to backup my checked out clearcase files.
What the script does is
1. Store the config spec in a temporary file
2. Get all the checkedout files
3. Using sed, prepend drive letter ( i run clearcase client over windows)
4. tar all the checkedout files and config spec. The backup filename contains the date and time, so
that backup date is kind of timestamped.
5. Move the tar file to a network location ( I have mapped B drive to a network location)
6. I have this shell script in the drive, where i have the view mounted and execute it whenever
i feel like backing up my code changes.
I am trying to automate the backup( say automatically backup every night at 10PM, thats when i go to sleep) job using crontab. But I think my cygwin is giving me trouble with this.
--------------------------------------------------------
#!/bin/bash
ct catcs > config_spec
ct lsco -avobs -cview -short > checkout.files_temp
sed -e 's/^/Y:/g' checkout.files_temp > checkout.files
tar -cvf a.tar `cat checkout.files` config_spec checkout.files
mv a.tar B:/Backup/backup_`date +"%Y%m%d%H%M%S"`.tar
rm checkout.files*
rm config_spec
--------------------------------------------------------
Subscribe to:
Post Comments (Atom)

2 comments:
Hey Ramesh,
I get the following error when i use sed.
W:\>sed -e 's/^/Y:/g' D:\checkout.files > D:\checkout.files2
'sed' is not recognized as an internal or external command,
operable program or batch file.
Thanks Ramesh for posting this.
It would definitely help many.. people..
Post a Comment