LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-25-2018, 04:57 AM   #1
Rajiv13s
LQ Newbie
 
Registered: Jun 2018
Posts: 2

Rep: Reputation: Disabled
is sftp supports overwrites files. i need to overwrites the files if already present


Hello ALL.

In my current project there is sftp methods used to download the files from remote server. currently we are deleting all the files and download the fresh files.

Now client want old source as it in case sftp unable to down load files due to some error and its continue with old source files in case sftp failed.

Please let me know if any one aware the solution of this issue.

Regards,
Rajiv
 
Old 06-25-2018, 05:09 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
#1 sftp download should overwrite just fine if the file ownership and permissions allow.

#2 you might want to investigate using rsync instead. If your download is from a single folder or tree it can handle file changes very efficiently.

Last edited by wpeckham; 06-25-2018 at 05:12 AM.
 
Old 07-04-2018, 04:53 AM   #3
Rajiv13s
LQ Newbie
 
Registered: Jun 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
#1 sftp download should overwrite just fine if the file ownership and permissions allow.

#2 you might want to investigate using rsync instead. If your download is from a single folder or tree it can handle file changes very efficiently.
Thanks for replying.

You mean permission of old files? in case if no permission then can we change the permission.
 
Old 07-04-2018, 05:42 AM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
Quote:
Originally Posted by Rajiv13s View Post
Thanks for replying.

You mean permission of old files? in case if no permission then can we change the permission.
I mean that if the folder permissions on the target folder, or the file permissions on the EXISTING target file, restrict writes then you will not be able to overlay the file. IF they allow, then sftp will do the job.
However
rsync can EDIT the file in place (optionally deleting obsolete files) to bring the source and target into agreement. This can be MUCH faster than overwriting files, since only the DIFFERENCES need to be transferred. Just something you might want to consider.
 
  


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
[SOLVED] dd overwrites file format siery Linux - Newbie 7 12-18-2015 11:15 PM
force tar clobbering (overwrites) with -C mrrhq Linux - Software 1 02-01-2015 11:52 AM
libvirtd overwrites iptables phatrik Linux - Virtualization and Cloud 3 06-11-2012 08:40 AM
Blackbox overwrites rc file salmonix Slackware 1 04-22-2007 12:00 PM
GRUB overwrites my changes mehlkelm Linux - Software 2 11-16-2004 03:12 AM

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

All times are GMT -5. The time now is 04:33 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