SHARE
TWEET
Untitled
a guest
Jun 9th, 2018
371
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #!/bin/bash
- username="username"
- password="unecessary if you have keyfile auth setup"
- host="IP address"
- port="port#"
- base_name="$(basename "$0")"
- lock_file="/tmp/$base_name.lock"
- trap "rm -f $lock_file; exit" INT TERM
- if [ -e "$lock_file" ]
- then
- echo "$base_name is running already."
- exit
- else
- touch "$lock_file"
- /usr/bin/lftp -p "$port" -u "$username","$password" sftp://"$host" << EOF
- mirror --use-pget-n=20 -P 5 /remote/path /local/path
- quit
- EOF
- rm "$lock_file"
- exit
- fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

