Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Please if you can help me when I made the backup in the "root" /home the size of the root space is not big enough so I try to make the backup on another place "/backup" but the following message appears : (-bash: file_name : Prmission denied)

share|improve this question
    
does svnadmin dump /path/to/repo > /dev/null and head /dev/urandom > /path/to/dumpfile work? –  krissi Aug 30 '10 at 12:43

2 Answers 2

up vote 0 down vote accepted

You wrote you use sudo. The command

# sudo svnadmin dump myrepos > dumpfile

will run `svnadmin dump myrepos with the rights of root. The > dumpfile part will not have the rights of root.

You could write a script, put the command in it and sudo the whole script or construct a one-liner like

# sudo svnadmin dump myrepos | sudo tee dumpfile > /dev/null

or

# sudo sh -c 'svnadmin dump myrepos > dumpfile'

or

# svnadmin dump myrepos | sudo tee dumpfile > /dev/null

if you are allowed to read myrepos with user-rights

share|improve this answer

You may not have permission to (a) read files in /home, especially if its a shared host, or (b) write to /backup. If you run it as root (using either su or sudo), you should be able to run the command.

EDIT: When you run sudo, what you'll want to do is sudo sh -c 'svnadmin dump myrepos > dumpfile'; that way, you're running the entire command--redirection and all--as root.

share|improve this answer
    
i used sudo but the same message appear !!! i don't konow why ... in other word the following command don't work any where elsa home "svnadmin dump myrepos > dumpfile" ... any other plase give me "NO Prmission" –  Mohammad AL-Rawabdeh Aug 30 '10 at 11:52
    
How did you run that command? If you did sudo svnadmin dump myrepos > dumpfile, you are only assuming superuser access for the svnadmin aspect. What you'll want to do is sudo sh -c 'svnadmin dump myrepos > dumpfile'; that way, you're running the entire command--redirection and all--as root. –  Andrew M. Aug 30 '10 at 12:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.