[Hampshire] Re: Automating rsync to run as root

Top Page

Reply to this message
Author: Russell Gadd
Date:  
To: hampshire lug
Subject: [Hampshire] Re: Automating rsync to run as root
Hi All,

Thanks very much for your replies to my post. The obvious answer was to use
sudo. Or su, but I think this may be not as secure? Anyway I have modified
my script to use sudo rsync which now works fine. I was a bit nonplussed by
having to use visudo but fortunately my copy of Debian popped up nano
instead of vi - my nephew has some experience of Linux and had previously
recommended learning a bit of vi but I'll leave that to another time. In
sudoers I used an entry of
russell ALL=(ALL) ALL
I'll think about reducing this to only allow rsync to be run as root,
something like ?
russell ALL=(root) /usr/bin/rsync
The advantage of the first one is that I can use sudo at other times without
logging in to a terminal as root, but I think maybe this sudo power is more
risky than just allowing my limited user account to only run rsync as root.

Peter, I haven't yet set up email - something I need to look into (so many
things to get into...). I have had a brief look at backup programs such as
backup2l but all these seem to use cron to time backups rather than have
them invoked at will. I'm still happy with my backup scheme which has saved
me from disk failures and accidental deletions in the past. Also from rogue
apps, in which case I like to reload of a recent copy of the OS (not
trusting hidden material left behind by just trying to unistall or delete).
In fact I've had to use an image of Debian to reinstall it after playing
around with trying to change the partitioning scheme and screwing things up.
Separating the OS from user data allows me to keep "clean" and small system
images. I appreciate cron backup is good for its automation but this is my
personal PC and I am diligent about taking a daily backup which is actually
very quick with rsync which only has to deal with changed stuff.

Damian, I don't want more protection than my current scheme allows. I
appreciate a RAID scheme would give minute by minute backup, but my needs
are actually very modest - maybe my paranoia about backup gives the wrong
impression about the importance and extent of my work on the PC - this is
probably because I've been stung without backup in the past - not severely -
but enough to accept repeating a day's work but not anything longer.
Actually being able to do a backup by hitting a desktop icon does allow me
to vary the frequency so if I've done a good couple of hours work I don't
want to lose I can hit the icon then, not wait until logoff. I also tend to
save different versions of files of work in progress. If I was setting up
backup for someone else my approach would be completely different. You have
a nice solution in your idea of using a server but in my case this would be
a sledgehammer to crack a nut.

James, I'll have to look at your suggestions later - there could be some
mileage in what you say about "... create a disk image on the vfat partition
and format it as ext3".

Stuart, I could post my script but as it now works ok with sudo it seems
unnecessary to burden you with it. I need to run rsync as root simply
because otherwise it refuses to sync the vfat partitions. "You can mount a
vfat filesystem with a specific UID" - this is some more stuff I need to
look at - maybe my vfat setup is wrong. This would be the best solution if
it turns out that I don't need to run rsync as root.

I get the mailing list as a digest so I might have missed some more recent
ideas, but thanks to all of you for replying with some really good
information. If I have explained why I don't want to go down a suggested
route it isn't any criticism of the idea - on the contrary it is only to try
to explain my thinking. I'm very grateful for all your help - thanks again.

Russell