Works just fine when running it manually on the shell but when I setup a cronjob to run it on reboot I get "bad variable name".
#! /bin/sh
# /etc/init.d/duplicityCleanUp
export PASSPHRASE=foo
duplicity remove-older-than 30D --force --gio smb://remote/archiv/
duplicity remove-all-but-n-full 1 --force --gio smb://remote/archiv/
unset PASSPHRASE
There is a space between the #!
and the /bin/sh
. I don't think this is the reported problem but it needs fixing *
I guess that you are using a version of Unix or Linux where /bin/sh
is not bash so the
export syntax is wrong.
Alter your script to say
PASSPHRASE=foo
export PASSPHRASE
See this answer UNIX export command
* it's not a problem, see comments
They way you export or set your variables are incompatible with your shell. When executing the script - try and use different shell.
sh yourscript.sh
bash yourscript.sh
ksh yourscript.sh
csh yourscript.sh
zsh yourscript.sh
Mostly bash will work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With