Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- HOST="murlocs.org"
- USER="xx"
- PASS="xx"
- FTPURL="ftp://$USER:$PASS@$HOST"
- LCD="/root/test"
- RCS="/"
- base_name="$(basename "$0")"
- lock_file="/tmp/$base_name.lock"
- trap "rm -f $lock_file" SIGINT SIGTERM
- if [ -e "$lock_file" ]
- then
- echo "already running"
- exit
- else
- touch "$lock_file"
- lftp -c "set ftp:list-options -a; set ssl:verify-certificate no;
- open '$FTPURL';
- lcd $LCD;
- cd $RCS;
- mirror -c -P5 --verbose --newer-than=now-5minutes"
- quit
- rm -d "$lock_file"
- trap - SIGINT SIGTERM
- exit
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement