Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #beginning backup script
- rm -r /rd1000/*;
- cd /lsmnas/Backups/exchange;
- cp `ls -t1 /lsmnas/Backups/exchange/2010* | head -1` /rd1000;
- cd /lsmnas/Backups/lsm2k8;
- cp `ls -t1 /lsmnas/Backups/lsm2k8/lsm2k8* | head -1` /rd1000/;
- cd /lsmnas/Backups;
- cp `ls -t1 /lsmnas/Backups/vmwesx_LSMBES* | head -1` /rd1000/;
- cp `ls -t1 /lsmnas/Backups/vmwesx_LSMEX* | head -1` /rd1000/;
- cp `ls -t1 /lsmnas/Backups/vmwesx_LSMFS* | head -1` /rd1000/;
- cp `ls -t1 /lsmnas/Backups/vmwesx_LSMDC1* | head -1` /rd1000/;
- cp `ls -t1 /lsmnas/Backups/vmwesx_LSMSK* | head -1` /rd1000/;
- cp `ls -t1 /lsmnas/Backups/vmwesx_LSMFWv2* | head -1` /rd1000/;
- cp `ls -t1 /lsmnas/Backups/vmwesx_LSMES* | head -1` /rd1000/;
- cp /lsmnas/Backups/storykeeper/lsm_skbms.gz /rd1000;
- ls -lh /var/autofs/removeable/rd1000 > /home/scripts/status.txt;
- mail -s "Backup Status" -r origin@place.com destination@place.com < /home/scripts/status.txt;
- #end of backup
- Resulting emails
- This is what happens on manual execution of script (this is the desired result)
- total 117G
- -rwxr-x--- 1 root root 9.7G Apr 12 03:40 2010_04_12_00_41_10_502S.TIB
- -rwxr-x--- 1 root root 43G Apr 12 04:09 lsm2k8.tib_2010_04_11_23_30_05_886D.TIB
- -rwxr-xr-x 1 root root 933M Apr 12 04:52 lsm_skbms.gz
- -rw------- 1 root root 5.9G Apr 12 04:13 vmwesx_LSMBES_2010_04_11_20_45_15_497D.TIB
- -rw------- 1 root root 7.5G Apr 12 04:39 vmwesx_LSMDC1_2010_04_11_20_23_12_336D.TIB
- -rw------- 1 root root 3.6G Apr 12 04:51 vmwesx_LSMES_2010_04_11_19_00_03_859D.TIB
- -rw------- 1 root root 25G Apr 12 04:29 vmwesx_LSMEX_2010_04_11_19_05_47_512D.TIB
- -rw------- 1 root root 8.3G Apr 12 04:34 vmwesx_LSMFS_2010_04_11_19_59_17_428D.TIB
- -rw------- 1 root root 7.8G Apr 12 04:49 vmwesx_LSMFWv2_2010_04_11_20_11_31_009D.TIB
- -rw------- 1 root root 6.0G Apr 12 04:43 vmwesx_LSMSK_2010_04_11_20_35_05_475D.TIB
- This is what happens upon script being run by cron, every time. (drive runs out of space)
- total 147G
- -rwxr-x--- 1 root root 9.8G Mar 31 02:40 2010_03_29_00_40_13_086S.TIB
- -rwxr-x--- 1 root root 44G Mar 31 03:09 lsm2k8.tib_2010_03_30_23_30_07_651D.TIB
- -rwxr-x--- 1 root root 30G Apr 14 03:50 lsm2k8.tib_2010_04_13_23_30_06_584D.TIB
- -rwxr-xr-x 1 root root 933M Apr 14 03:51 lsm_skbms.gz
- -rw------- 1 root root 5.9G Mar 31 03:13 vmwesx_LSMBES_2010_03_30_20_18_31_487D.TIB
- -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMBES_2010_04_13_20_35_43_882D.TIB
- -rw------- 1 root root 7.5G Mar 31 03:40 vmwesx_LSMDC1_2010_03_30_20_39_38_648D.TIB
- -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMDC1_2010_04_13_20_23_38_480D.TIB
- -rw------- 1 root root 3.6G Mar 31 03:51 vmwesx_LSMES_2010_03_30_19_00_04_107D.TIB
- -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMES_2010_04_13_19_00_04_131D.TIB
- -rw------- 1 root root 25G Mar 31 03:29 vmwesx_LSMEX_2010_03_30_19_06_42_908D.TIB
- -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMEX_2010_04_13_19_05_52_105D.TIB
- -rw------- 1 root root 8.4G Mar 31 03:35 vmwesx_LSMFS_2010_03_30_19_55_12_483D.TIB
- -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMFS_2010_04_13_19_59_34_262D.TIB
- -rw------- 1 root root 7.8G Mar 31 03:49 vmwesx_LSMFWv2_2010_03_30_20_06_07_509D.TIB
- -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMFWv2_2010_04_13_20_11_48_057D.TIB
- -rw------- 1 root root 6.0G Mar 31 03:44 vmwesx_LSMSK_2010_03_30_20_29_24_088D.TIB
- -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMSK_2010_04_13_20_47_14_495D.TIB
- This is my cronttab
- SHELL=/bin/bash
- PATH=/sbin:/bin:/usr/sbin:/usr/bin
- MAILTO=root
- HOME=/
- # run-parts
- 01 * * * * root run-parts /etc/cron.hourly
- 00 4 * * * root run-parts /etc/cron.daily
- 22 4 * * 0 root run-parts /etc/cron.weekly
- 42 4 1 * * root run-parts /etc/cron.monthly
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement