LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-22-2014, 12:17 PM   #1
vhegde
LQ Newbie
 
Registered: Dec 2014
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 12-22-2014, 07:50 PM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Do you work for Sony?

You've hard-coded all the security information into that little script...
 
Old 12-23-2014, 03:00 AM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Passwordless connection to sftp server using lftp aarelovich Linux - Software 5 03-25-2014 09:16 AM
Error dowloading with lftp from sftp server: get: Access failed: No such file dgerber Linux - Newbie 0 02-10-2013 04:47 AM
[SOLVED] How to make several "renames" by inoking a single command? Make a shell script file? Foxbat1155 Linux - Newbie 20 11-25-2011 09:13 AM
Error Configuration file /usr/local/centreon/ODS/etc/conf.pm not found. existing jsaravana87 Linux - Server 1 10-08-2011 10:39 AM
LXer: Modifying Existing Local Zone File Systems On Solaris 10 Unix LXer Syndicated Linux News 0 10-22-2008 02:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration