Article Title: tiptop automatic backup script backup. sh. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
# Create a crontab Scheduler
Crontab-e
0 *** sh/u3/backup/tool/backup. sh # automatic backup at every day
0 6 *** sh/bin/ftpauto # automatically upload at every morning
# Backup. sh
LANG = en_US
Ans = 'date | awk' {print $1 }''
Case $ ans in
Mon) cd/u3/backup/Mon ;;
Tue) cd/u3/backup/Tue ;;
Wed) cd/u3/backup/Wed ;;
Thu) cd/u3/backup/Thu ;;
Fri) cd/u3/backup/Fri ;;
Sat) cd/u3/backup/Sat ;;
Sun) cd/u3/backup/Sun ;;
Esac
TIME = 'date' + % Y % m % d % H % m''
If ["'date' + % h''" = "12"]
Then
Rm-rf *
Fi
For f in ds ds1
Do
Unload. sh $ {f}
Tar czvf rj0000f0000.tar.gz $ {f}. tmp
Mv compression f}.tar.gz compression f}_$time.tar.gz
Exp $ {f}/$ {f} file = exp _ $ {f}. dmp
Mv exp _ $ {f}. dmp exp _ $ {f} _ $ TIME. dmp
Droptemp_auto $ {f }$ {f}
Done
If ["'date' + % h''" = "23"]
Then
Tar czvf topprod.tar.gz/u1/topprod
Ftpauto # automatic upload
Tar rvf/dev/st0 ds1 * .tar.gz
Fi
Rm-rf *. tmp