Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/bash
  2. HOST="murlocs.org"
  3. USER="xx"
  4. PASS="xx"
  5. FTPURL="ftp://$USER:$PASS@$HOST"
  6. LCD="/root/test"
  7. RCS="/"
  8.  
  9. base_name="$(basename "$0")"
  10. lock_file="/tmp/$base_name.lock"
  11. trap "rm -f $lock_file" SIGINT SIGTERM
  12. if [ -e "$lock_file" ]
  13. then
  14. echo "already running"
  15. exit
  16. else
  17. touch "$lock_file"
  18. lftp -c "set ftp:list-options -a; set ssl:verify-certificate no;
  19. open '$FTPURL';
  20. lcd $LCD;
  21. cd $RCS;
  22. mirror -c -P5 --verbose --newer-than=now-5minutes"
  23. quit
  24.  
  25. rm -d "$lock_file"
  26. trap - SIGINT SIGTERM
  27. exit
  28. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement