LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   (ns)sbackup.conf file meanings (https://www.linuxquestions.org/questions/linux-software-2/ns-sbackup-conf-file-meanings-832389/)

rogerw05465 09-15-2010 02:28 PM

(ns)sbackup.conf file meanings
 
Using NSsbackup on Ubuntu 10.04 desktop. Generally all is successful - except for two things.

First: If my USB WD Passport destination drive is not awake at the time the backup is started, the backup fails. But if I run ls -al on the drive, that wakes it up enough to take the backup. How to deal with this problem?

Second, I have a question on the meanings of one of the commands: "format". In some examples I see "format = none", in others "format=1". What do these mean? Is this related to what type of compression might be being used after the tarball is created? Compression type (by that name) is not mentioned in the /etc/nssbackup.conf file, for instance.

Thanks for any and all help

Roger

tredegar 09-16-2010 10:50 AM

I can only answer your first Q:
To wake up the drive, you need to wrap your call to nssbackup in a little bash script that wakes the drive up before calling nssbackup
It's very simple:

Code:

#!/bin/bash
ls /path/to/backup > /dev/null
/path/to/nssbackup  options

Name the script whatever you like, make it executable chmod +x /path/to/wrapper and then call it.

http://www.google.com/linux (bookmark that link - it's very useful for all things linux) may help you with your other Q.

rogerw05465 09-17-2010 09:29 AM

Tredegar, thanks for this - and it is exactly what I tried as well, thinking to then run that script at a certain time via cron. The failure there? I have to run nssbackup via sudo right now, so here we have a fork to two possible paths: "How to call sudo in a script?" is the first fork, and that would be interesting to know how to do. The second fork is that the nssbackup log file says the nssbackup process is reverting to the user rogerw (me). I wonder if I really do need to be running nssbackup through sudo. For the latter issue, can I just chmod the nssbackup program to rogerw:rogerw and have it run happily without sudo? I guess that would work if all the files it was backing up were accessible by rogerw. Thoughts?

Roger

tredegar 09-17-2010 09:37 AM

Quote:

"How to call sudo in a script?"
You can't, or shouldn't if you want the backup to run unattended, and keep your system secure.

Backups are generally best run as root anyway (that way all your users can be backed up).

You could run your backup from root's crontab, then it'd be run as root.

I don't use nssbackup, (I just use rsync, which is fast, and easy ) so I can't help you with how it works.


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