Thread View: alt.privacy.anon-server
3 messages
3 total messages
Started by Nomen Nescio
Sat, 28 May 2016 19:09
Re: Rsync Between 2 Users on Same Computer
Author: Nomen Nescio
Date: Sat, 28 May 2016 19:09
Date: Sat, 28 May 2016 19:09
58 lines
3792 bytes
3792 bytes
On Sat, 28 May 2016 03:10:38 -0000 (UTC), you wrote: > > On 2016-05-28, Bit Twister <BitTwister@mouse-potato.com> wrote: > > On Sat, 28 May 2016 01:45:00 +0200 (CEST), Anonymous Remailer (austria) wrote: > >> > >> I have a directory of files that I would like to sync on a nightly > >> basis between two users on the same computer. The master files will > >> be owned by the root user and the sync will be done to another user > >> on the same server. > >> > >> Can someone provide the correct syntax to perform this task? > > > > man rsync should provide all the options available to do whatever > > you like. > > > > If you want exact copy then something like > > rsync -aAHSXxv --delete /root/wherever/ /home/user_here/wherever > > going to guess you will also need to add the --chown=USER:GROUP switch/data. > > That assumes that the stuff in /root/whatever is the true stuff, and > anything in /home/user)here/wherever is junk, which, if it differs needs > to be eliminated. If that is not what you want, you will need to change > the option. > Ie, asking for help and then not giving us the least indication of what > you want to accomplish is sure to get you advice which is not > appropriate to what you want. > Please tell us in more detail what you want to accomplish. I have a backup of my server that creates a .gz file and places it in a folder called panelbackup which is owned by root. I would like to copy this file to another user on my computer that has access to syncthing. I use syncthing to replicate various folders from my server to my laptop. I can copy the .gz file that is owned by root to another user on the same computer that has access to syncthing and be done with it, but I would like to have rsync do the copying for me and then add this to a cron job. Syncthing is launched as a non-root user which means that I can't sync any of my root folders to other users on remote computers. So the plan was to figure out how to copy a file or folder that is owned by root to a non root user and then syncthing the results to my remote computer as a backup. I created a text file as root and changed the owner to user2 and then tried to rsync the text file from root to user2 and it didn't work. I also tried to rsync the file when it was owned as root to a directory that is owned by user2 and couldn't get that work either. The commands I have tried when text.txt was owned as root and user2 are: rsync -a /panelbackup/test.txt /home/user2folder/test.txt rsync -a /panelbackup/test.txt /home/user2folder/ rsync -a /panelbackup/test.txt ~/user2folder/test.txt rsync -a /panelbackup/test.txt ~/user2folder/ Server is Debian 7.0 with syncthing v0.13.4, Linux (64 bit) Windows 10 Laptop with syncthing v0.13.4, Windows (64 bit) rsync version 3.0.9 protocol version 30
Re: Rsync Between 2 Users on Same Computer
Author: Anonymous
Date: Sat, 28 May 2016 23:31
Date: Sat, 28 May 2016 23:31
62 lines
3733 bytes
3733 bytes
> On Sat, 28 May 2016 03:10:38 -0000 (UTC), you wrote: > >> >> On 2016-05-28, Bit Twister <BitTwister@mouse-potato.com> wrote: >>> On Sat, 28 May 2016 01:45:00 +0200 (CEST), Anonymous Remailer (austria) wrote: >>>> >>>> I have a directory of files that I would like to sync on a nightly >>>> basis between two users on the same computer. The master files will >>>> be owned by the root user and the sync will be done to another user >>>> on the same server. >>>> >>>> Can someone provide the correct syntax to perform this task? >>> >>> man rsync should provide all the options available to do whatever >>> you like. >>> >>> If you want exact copy then something like >>> rsync -aAHSXxv --delete /root/wherever/ /home/user_here/wherever >>> going to guess you will also need to add the --chown=USER:GROUP switch/data. >> >> That assumes that the stuff in /root/whatever is the true stuff, and >> anything in /home/user)here/wherever is junk, which, if it differs needs >> to be eliminated. If that is not what you want, you will need to change >> the option. >> Ie, asking for help and then not giving us the least indication of what >> you want to accomplish is sure to get you advice which is not >> appropriate to what you want. >> Please tell us in more detail what you want to accomplish. > > I have a backup of my server that creates a .gz file and places it > in a folder called panelbackup which is owned by root. I would like > to copy this file to another user on my computer that has access to > syncthing. I use syncthing to replicate various folders from my > server to my laptop. I can copy the .gz file that is owned by root > to another user on the same computer that has access to syncthing > and be done with it, but I would like to have rsync do the copying > for me and then add this to a cron job. > > Syncthing is launched as a non-root user which means that I can't > sync any of my root folders to other users on remote computers. So > the plan was to figure out how to copy a file or folder that is > owned by root to a non root user and then syncthing the results to > my remote computer as a backup. > > I created a text file as root and changed the owner to user2 and > then tried to rsync the text file from root to user2 and it didn't > work. I also tried to rsync the file when it was owned as root to a > directory that is owned by user2 and couldn't get that work either. > The commands I have tried when text.txt was owned as root and user2 > are: > > rsync -a /panelbackup/test.txt /home/user2folder/test.txt > rsync -a /panelbackup/test.txt /home/user2folder/ > rsync -a /panelbackup/test.txt ~/user2folder/test.txt > rsync -a /panelbackup/test.txt ~/user2folder/ > > Server is Debian 7.0 with syncthing v0.13.4, Linux (64 bit) > Windows 10 Laptop with syncthing v0.13.4, Windows (64 bit) > rsync version 3.0.9 protocol version 30 Why don't you set up a cron to copy the root file to the Syncthing user a couple of minutes before that user does its rsync.
Re: Rsync Between 2 Users on Same Computer
Author: elvis-85503
Date: Sun, 29 May 2016 03:08
Date: Sun, 29 May 2016 03:08
18 lines
1599 bytes
1599 bytes
> The commands I have tried when text.txt was owned as root and user2
> are:
>
> rsync -a /panelbackup/test.txt /home/user2folder/test.txt
> rsync -a /panelbackup/test.txt /home/user2folder/
> rsync -a /panelbackup/test.txt ~/user2folder/test.txt
> rsync -a /panelbackup/test.txt ~/user2folder/
>
> Server is Debian 7.0 with syncthing v0.13.4, Linux (64 bit)
> Windows 10 Laptop with syncthing v0.13.4, Windows (64 bit)
> rsync version 3.0.9 protocol version 30
If the problem is that running rsync as root and running rsync as non-root
both have unacceptable outcomes with owners and modes then why not
(as root)
rsync -e ssh /panelbackup/test.txt user2@127.0.0.1:
with appropriate ssh access from root to user2.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads