LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   rsync file to file without specifying the parent folder as a destination? (https://www.linuxquestions.org/questions/linux-general-1/rsync-file-to-file-without-specifying-the-parent-folder-as-a-destination-4175685524/)

postcd 11-20-2020 04:21 AM

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

pan64 11-20-2020 04:24 AM

?
did you try that? that should work (obviously depends on the permissions)

TB0ne 11-20-2020 10:15 AM

Quote:

Originally Posted by postcd (Post 6187156)
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???


All times are GMT -5. The time now is 11:26 PM.