/[MITgcm]/mitgcm.org/notes/forge_backup
ViewVC logotype

Annotation of /mitgcm.org/notes/forge_backup

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Mon Apr 4 15:56:59 2005 UTC (20 years, 3 months ago) by edhill
Branch: MAIN
CVS Tags: HEAD
 o initial check-in

1 edhill 1.1 #! /bin/bash
2    
3     # Ed Hill
4     # Mon Apr 4 11:33:19 EDT 2005
5    
6     # A quick script to backup forge to one of the RAID disks
7    
8     rm -rf /scratch/root/backup
9     mkdir -p /scratch/root/backup
10     chmod +rx /scratch/root/backup
11    
12     cd /scratch/root/backup
13     /usr/bin/mysqldump -A | gzip > ./mysql_dump_all.sql.gz
14    
15     dirlist="/etc/httpd /etc/mail /etc/mailman"
16     dirlist="$dirlist /var/lib/mailman/lists /var/lib/mailman/archives"
17     tar -czf ./forge_etc_dirs.tar.gz $dirlist > /dev/null 2>&1
18    
19     chmod -R +r /scratch/root/backup
20     today=`date +%Y%m%d`
21     su edhill -c "cp -r /scratch/root/backup /u/forge/backups/backup_$today"
22    
23     cd /u/forge/backups
24     remove=`ls -1 | awk '(NR > 3){print $0}'`
25     chars=`echo $remove | wc -c`
26     if test ! "x$chars" = x ; then
27     su edhill -c "rm -rf $remove"
28     fi
29    

  ViewVC Help
Powered by ViewVC 1.1.22