Guest User

Untitled

a guest
Jun 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.80 KB | None | 0 0
  1. that's because the script is borked. If condition with -e (exists) arg is not setup correctly for wildcard searching when there is more than 1 result.
  2.  
  3. Change the lines from:
  4.  
  5.  
  6. touch purgelist
  7. if [[ -e $BKUP_PATH/$WORLD/*-incr.tgz ]]; then
  8.        find $WORLD/*-incr.tgz -type f -mtime +$BKUP_DAYS_INCR -print > purgelist
  9. fi
  10. if [[ -e $BKUP_PATH/$WORLD/*-full.tgz ]]; then
  11.        find $WORLD/*-full.tgz -type f -mtime +$BKUP_DAYS_FULL -print >> purgelist
  12. fi
  13.  
  14. to:
  15.  
  16.  
  17. touch purgelist
  18. if [[ -e `echo $BKUP_PATH/$WORLD/*-incr.tgz | cut -d " " -f1` ]]; then
  19.        find $WORLD/*-incr.tgz -type f -mtime +$BKUP_DAYS_INCR -print > purgelist
  20. fi
  21. if [[ -e `echo $BKUP_PATH/$WORLD/*-full.tgz | cut -d " " -f1` ]]; then
  22.        find $WORLD/*-full.tgz -type f -mtime +$BKUP_DAYS_FULL -print >> purgelist
  23. fi
Add Comment
Please, Sign In to add comment