LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-20-2020, 04:21 AM   #1
postcd
Member
 
Registered: Oct 2013
Posts: 527

Rep: Reputation: Disabled
Question rsync file to file without specifying the parent folder as a destination?


Hello,
i see the way to copy the file using rsync is to specify the destination folder.
But how can i please copy using rsync while the destination is not folder but the full path to file?

var=/path2/file
rsync -av /path1/file $var

Last edited by postcd; 11-20-2020 at 04:23 AM.
 
Old 11-20-2020, 04:24 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
?
did you try that? that should work (obviously depends on the permissions)

Last edited by pan64; 11-20-2020 at 04:26 AM.
 
1 members found this post helpful.
Old 11-20-2020, 10:15 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,689

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by postcd View Post
Hello,
i see the way to copy the file using rsync is to specify the destination folder. But how can i please copy using rsync while the destination is not folder but the full path to file?
Code:
var=/path2/file
rsync -av /path1/file $var
Please check your several other rsync threads, going back *SIX YEARS*:

https://www.linuxquestions.org/quest...ge-4175503702/
https://www.linuxquestions.org/quest...er-4175525376/
https://www.linuxquestions.org/quest...ng-4175528225/
https://www.linuxquestions.org/quest...ze-4175538411/
https://www.linuxquestions.org/quest...nc-4175585087/
https://www.linuxquestions.org/quest...le-4175601951/
https://www.linuxquestions.org/quest...on-4175610556/
https://www.linuxquestions.org/quest...nt-4175612479/

Again, you could have just tried what you posted, or (as you've been told MANY TIMES), read the man page on rsync, to find out what the options do quicker than you could have posted here. After using rsync for six years, have you not gained any knowledge about how it works???
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create 5 processes from a common parent and ensure that the parent terminates after c pro_learner Linux - Newbie 1 03-06-2013 09:25 AM
[SOLVED] [ask]Specifying destination directory when installing Slackware ethereal1m Linux - Newbie 2 01-25-2010 04:37 AM
File descriptors shared between child and parent causing parent to hang. bharadiaam Linux - Newbie 1 03-02-2009 01:01 AM
destination unavailable W/ vpn. All other net destination o.k. MikeOfAustin Linux - Networking 1 04-07-2007 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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