ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
what do you mean? start a command from input? maybe you're talking about exec. do
I've made a backup server using dar & sarab. it will backup my mailserver, fileserver and webservers sql files.
Because i want to seperate the backup for all 3 servers, I have to specify where the sarab.conf is after the basic command /usr/local/sarab/sarab.sh.
So if I only need to backup 1 server the command /usr/local/sarab/sarab.sh was enough to run the backup. For the second server, I need to specify the path of sarab.conf after the basic command.
It works if I type /usr/local/sarab/sarab.sh /etc/sarab/test/sarab.conf from the command line.
My second server will be backupped.
Now i want to put this in cron.
when I put 13 10 * * 2-6 /usr/local/sarab/sarab.sh in cron it works.
When I put 13 10 * * 2-6 /usr/local/sarab/sarab.sh /etc/sarab/test/sarab.conf it doesn't work.
that's why I thought to make a script to execute that last command and put the script in cron.
I tried to put exec in fron of the command, but that didn't work either.
echo a >/var/log/sarab
echo b >>/var/log/sarab
/usr/local/sarab/sarab.sh /etc/sarab/test/sarab.conf >/dev/null
echo c >>/var/log/sarab
there is an another option. make a duplicate copy of the /usr/local/sarab/sarab.sh then modify the replica in which /etc/sarab/test/sarab.conf is set as the default argument. run the replica afterwards. example '/usr/local/sarab/sarab2.sh
example if you have a code like this:
# change this to