Advertisement
Guest User

Untitled

a guest
May 19th, 2017
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. #beginning backup script
  2.  
  3. rm -r /rd1000/*;
  4.  
  5. cd /lsmnas/Backups/exchange;
  6.  
  7. cp `ls -t1 /lsmnas/Backups/exchange/2010* | head -1` /rd1000;
  8.  
  9.  
  10. cd /lsmnas/Backups/lsm2k8;
  11.  
  12. cp `ls -t1 /lsmnas/Backups/lsm2k8/lsm2k8* | head -1` /rd1000/;
  13.  
  14.  
  15.  
  16. cd /lsmnas/Backups;
  17.  
  18. cp `ls -t1 /lsmnas/Backups/vmwesx_LSMBES* | head -1` /rd1000/;
  19. cp `ls -t1 /lsmnas/Backups/vmwesx_LSMEX* | head -1` /rd1000/;
  20. cp `ls -t1 /lsmnas/Backups/vmwesx_LSMFS* | head -1` /rd1000/;
  21. cp `ls -t1 /lsmnas/Backups/vmwesx_LSMDC1* | head -1` /rd1000/;
  22. cp `ls -t1 /lsmnas/Backups/vmwesx_LSMSK* | head -1` /rd1000/;
  23. cp `ls -t1 /lsmnas/Backups/vmwesx_LSMFWv2* | head -1` /rd1000/;
  24. cp `ls -t1 /lsmnas/Backups/vmwesx_LSMES* | head -1` /rd1000/;
  25. cp /lsmnas/Backups/storykeeper/lsm_skbms.gz /rd1000;
  26.  
  27.  
  28. ls -lh /var/autofs/removeable/rd1000 > /home/scripts/status.txt;
  29. mail -s "Backup Status" -r origin@place.com destination@place.com < /home/scripts/status.txt;
  30.  
  31. #end of backup
  32.  
  33.  
  34.  
  35.  
  36. Resulting emails
  37.  
  38. This is what happens on manual execution of script (this is the desired result)
  39.  
  40. total 117G
  41. -rwxr-x--- 1 root root 9.7G Apr 12 03:40 2010_04_12_00_41_10_502S.TIB
  42. -rwxr-x--- 1 root root 43G Apr 12 04:09 lsm2k8.tib_2010_04_11_23_30_05_886D.TIB
  43. -rwxr-xr-x 1 root root 933M Apr 12 04:52 lsm_skbms.gz
  44. -rw------- 1 root root 5.9G Apr 12 04:13 vmwesx_LSMBES_2010_04_11_20_45_15_497D.TIB
  45. -rw------- 1 root root 7.5G Apr 12 04:39 vmwesx_LSMDC1_2010_04_11_20_23_12_336D.TIB
  46. -rw------- 1 root root 3.6G Apr 12 04:51 vmwesx_LSMES_2010_04_11_19_00_03_859D.TIB
  47. -rw------- 1 root root 25G Apr 12 04:29 vmwesx_LSMEX_2010_04_11_19_05_47_512D.TIB
  48. -rw------- 1 root root 8.3G Apr 12 04:34 vmwesx_LSMFS_2010_04_11_19_59_17_428D.TIB
  49. -rw------- 1 root root 7.8G Apr 12 04:49 vmwesx_LSMFWv2_2010_04_11_20_11_31_009D.TIB
  50. -rw------- 1 root root 6.0G Apr 12 04:43 vmwesx_LSMSK_2010_04_11_20_35_05_475D.TIB
  51.  
  52.  
  53. This is what happens upon script being run by cron, every time. (drive runs out of space)
  54.  
  55. total 147G
  56. -rwxr-x--- 1 root root 9.8G Mar 31 02:40 2010_03_29_00_40_13_086S.TIB
  57. -rwxr-x--- 1 root root 44G Mar 31 03:09 lsm2k8.tib_2010_03_30_23_30_07_651D.TIB
  58. -rwxr-x--- 1 root root 30G Apr 14 03:50 lsm2k8.tib_2010_04_13_23_30_06_584D.TIB
  59. -rwxr-xr-x 1 root root 933M Apr 14 03:51 lsm_skbms.gz
  60. -rw------- 1 root root 5.9G Mar 31 03:13 vmwesx_LSMBES_2010_03_30_20_18_31_487D.TIB
  61. -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMBES_2010_04_13_20_35_43_882D.TIB
  62. -rw------- 1 root root 7.5G Mar 31 03:40 vmwesx_LSMDC1_2010_03_30_20_39_38_648D.TIB
  63. -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMDC1_2010_04_13_20_23_38_480D.TIB
  64. -rw------- 1 root root 3.6G Mar 31 03:51 vmwesx_LSMES_2010_03_30_19_00_04_107D.TIB
  65. -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMES_2010_04_13_19_00_04_131D.TIB
  66. -rw------- 1 root root 25G Mar 31 03:29 vmwesx_LSMEX_2010_03_30_19_06_42_908D.TIB
  67. -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMEX_2010_04_13_19_05_52_105D.TIB
  68. -rw------- 1 root root 8.4G Mar 31 03:35 vmwesx_LSMFS_2010_03_30_19_55_12_483D.TIB
  69. -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMFS_2010_04_13_19_59_34_262D.TIB
  70. -rw------- 1 root root 7.8G Mar 31 03:49 vmwesx_LSMFWv2_2010_03_30_20_06_07_509D.TIB
  71. -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMFWv2_2010_04_13_20_11_48_057D.TIB
  72. -rw------- 1 root root 6.0G Mar 31 03:44 vmwesx_LSMSK_2010_03_30_20_29_24_088D.TIB
  73. -rw------- 1 root root 0 Apr 14 03:50 vmwesx_LSMSK_2010_04_13_20_47_14_495D.TIB
  74.  
  75.  
  76.  
  77. This is my cronttab
  78.  
  79. SHELL=/bin/bash
  80. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  81. MAILTO=root
  82. HOME=/
  83.  
  84. # run-parts
  85. 01 * * * * root run-parts /etc/cron.hourly
  86. 00 4 * * * root run-parts /etc/cron.daily
  87. 22 4 * * 0 root run-parts /etc/cron.weekly
  88. 42 4 1 * * root run-parts /etc/cron.monthly
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement