lftp sftp get - command renames existing local file with suffix tilde
Hi,
Below script used for sftp get, #/bin/bash USER=xxx PASS=xxx HOST=xxx REMOTE_FILE=$1 LOCAL_FILE_LOC=$2 cd $LOCAL_FILE_LOC lftp sftp://$USER:$PASS@$HOST:10022 -e "get $REMOTE_FILE; bye" If file does not exist in sftp server, and file (same as remote file name) exists in local dir, above script throws error and renames local file with suffix ~. For example: If file name is 'xyz_file' after script execution it throws error: get: Access failed: /xyz_file: Specified file path is invalid. and renames the local file to 'xyz_file~' Any idea why its happening. |
Do you work for Sony? :doh:
You've hard-coded all the security information into that little script... |
See man page of lftp
man lftp search for xfer:make-backup option and change it as your liking in the configuration file of lftp. |
All times are GMT -5. The time now is 12:07 PM. |