Re: /home is symlinked to /usr/home - question about backups

2006-03-20 Thread Alex Zbyslaw

Pat Maddox wrote:


However if I run rsync -avz to back up my
server, it creates something like this:

/backup/march/19/home -> /usr/home

So if I were to go to /backup/march/19 and rm -rf * wouldn't it go and
delete everything in /usr/home?  

Should add:  In you shell, alias rm to "rm -i" which will ask you about 
deleting anything and everything.  For an rm -r, once you are *sure* 
that you are deleting the right thing, you can ^C, pull back your 
command line and edit it to say "/bin/rm ...".  If you are sure you are 
deleting the right thing, and if you always edit the command line then 
you should never(*) delete something you didn't want to.


(*) Of course, there will still be times when you are not paying enough 
attention and still manage to delete something you didn't intend to, but 
those times should be greatly reduced :-)


--Alex

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: /home is symlinked to /usr/home - question about backups

2006-03-20 Thread Alex Zbyslaw

Pat Maddox wrote:


I got a dedicated server a while ago, and it came with /home symlinked
to /usr/home.  I'm not entirely sure why, to tell you the truth, but
it's never posed a problem.  However if I run rsync -avz to back up my
server, it creates something like this:

/backup/march/19/home -> /usr/home

So if I were to go to /backup/march/19 and rm -rf * wouldn't it go and
delete everything in /usr/home?  That's obviously not my intended
result.  I've read all the symlink options in man rsync but honestly
am not sure what it is that I need to do.  Ideally I'd like to have
symlinks reference the relative file..so something like
/backup/march/19/home -> /backup/march/19/usr/home

That way I don't lose all my stuff if I remove the file from backup. 
Right now I'm just ignoring /home when I rsync, but it makes me kind

of worried that if I ever backup without ignoring /home and then
delete my backup I might lose my live data...I could really use some
info.

 


You could always make some dummy directories and symlinks and try it :-)

But, no, it won't delete the real thing *unless you put a / on the 
end*.  If you don't put the trailing slash then the symlink is deleted.  
If you put the trailing slash, then the symlink is dereferenced and the 
contents recursively deleted.


If you did what you wanted with rsync, you wouldn't correctly recover 
symlinks.


The rm man page says:

The rm utility removes symbolic links, not the files referenced by the
links.

--Alex

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


/home is symlinked to /usr/home - question about backups

2006-03-19 Thread Pat Maddox
I got a dedicated server a while ago, and it came with /home symlinked
to /usr/home.  I'm not entirely sure why, to tell you the truth, but
it's never posed a problem.  However if I run rsync -avz to back up my
server, it creates something like this:

/backup/march/19/home -> /usr/home

So if I were to go to /backup/march/19 and rm -rf * wouldn't it go and
delete everything in /usr/home?  That's obviously not my intended
result.  I've read all the symlink options in man rsync but honestly
am not sure what it is that I need to do.  Ideally I'd like to have
symlinks reference the relative file..so something like
/backup/march/19/home -> /backup/march/19/usr/home

That way I don't lose all my stuff if I remove the file from backup. 
Right now I'm just ignoring /home when I rsync, but it makes me kind
of worried that if I ever backup without ignoring /home and then
delete my backup I might lose my live data...I could really use some
info.

Pat
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"