backup apparently not working

luke speakup at lists.tacticus.com
Wed Nov 12 19:24:56 EST 2008


On Sat, 8 Nov 2008, Tyler Littlefield wrote:

> First, I'm running the script from command line:
> ./backup.sh
> the line in the script works great, but when I run it from the script, it says
> it's cowardly refusing to create empty archives.

Almost certainly, it doesn't know where your home directory is, and 
therefore doesn't know how to expand the tilde.

Switch from using ~/whatever to $HOME/whatever, and make sure that $HOME 
is set.

> Also, when it runs, it shows removing leading slash, and that's what's sent to
> me in my cron mail.

You might find the -C (that's a cap C) option useful, to remove all this 
business of directories and slashes and relative paths.

> Is there a way I can direct errors to /dev/null from within the script?

You can, but it is rather inadvisable--you want to see errors, you just 
want not to see warnings.  You can get rid of warnings by using the 
command in a way that doesn't generate them.  The -C option is one way to 
achieve this.

"2> /dev/null" will redirect STDERR, if you really must.

> It runs apt-get update
> and then sends me mail with all the output--I've tried
> apt-get update>/dev/null

Forgive me, but you seem to have this urge to hide errors or unwanted 
output, rather than to run programs in a way which does not create them.
While that seems as if it should be the same thing, it is not, because 
such hiding can be distructive when real errors (no space left on device, 
could not read block, etc.) occur.

With apt-get (and most of the apt tools), a set of "-q" options, will get 
rid of all that updating output, and show you only real errors.  For 
example:

apt-get -q -q update

Probably "apt-get -qq update" will also work, although I haven't tried it, 
since I have all of this aliased.

Regards,

Luke



More information about the Speakup mailing list