ตัวอย่าง Run .sh ใน Ubuntu การต่อ Sting ระว่างตัวแปรและ String
- D_01_S1="01-ฝข.1";
- D_01_SS2="01-งขต.1";
- snapfile=snap.$D_01_S1.$DayOfWeek
- cp snap.$D_01_S1 $snapfile
- tar --listed-incremental=$snapfile -cpzf DataCenter_$Days.inc.5.Department.01-ฝข.1.tar.gz $department/$D_01_S1
- mv DataCenter_$Days.inc.5.Department.01-ฝข.1.tar.gz /BACKUP/BackupToQnap/ &
- snapfile=snap.$D_01_SS2.$DayOfWeek
- cp snap.$D_01_SS2 $snapfile
- tar --listed-incremental=$snapfile -cpzf DataCenter_$Days.inc.5.Department.01-งขต.1.tar.gz $department/$D_01_SS2
- mv DataCenter_$Days.inc.5.Department.01-งขต.1.tar.gz /BACKUP/BackupToQnap/ &
- #### For String ##########
- snapfile=snap.00-Public.$DayOfWeek
- cp snap.00-Public $snapfile
- tar --listed-incremental=$snapfile -cpzf DataCenter_$Days.inc.5.Department.00-Public.tar.gz $department"/00-Public"
- mv DataCenter_$Days.inc.5.Department.00-Public.tar.gz /BACKUP/BackupToQnap/ &
- snapfile=snap.01-งสข.$DayOfWeek
- cp snap.01-งสข $snapfile
- tar --listed-incremental=$snapfile -cpzf DataCenter_$Days.inc.5.Department.01-งสข.tar.gz $department"/01-งสข"
- mv DataCenter_$Days.inc.5.Department.01-งสข.tar.gz /BACKUP/BackupToQnap/ &
File Example ที่เครื่อง Datacenter
- nano /DATA/backup-inc.sh
No comments:
Post a Comment