Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I think the proper place to put scripts for boot is in the init scripts. I think Ubuntu now uses the Upstart system, it used to use files in /etc/init.d. Not sure at what point that migration occurred, but those are your two best options.
I found that particular crontab syntax here: http://www.debianhelp.co.uk/crontab.htm
It seems like it would be pretty handy for things you want to run weekly, monthly, etc.
I'm trying out the init.d/rc1.d symlink setup for now. Hopefully this will be a bit more stable.
On a different note, I have an opinion question: The monitor script waits until another script (we'll call it configure.sh) arrives from a remote machine, and then runs it. Configure.sh then runs the two actual business scripts that I need. Does that sound like a reasonable method or is there a better way than daisy-chaining scripts like that?
EDIT: Hm. putting the monitor.sh script in /etc/init.d and creating a symlink to it called Smonitor in rc1.d doesn't seem to be working. I don't think it's running at all. Granted, I'm not sure, because I'm booting up a remote machine here, but since none of the output directories are getting created I think monitor.sh isn't getting executed on reboot. Do I need to change my script to accept a "start" argument like it says in the Debian policy manual?
Tink-
It appears that it's the 4th Berkeley Distribution, dated 31 October 2006. I can't find a specific version though. I have a bit of an different question for you- remember this while loop condition you gave me a month or so ago?
Code:
while $( ec2din --simple | awk 'BEGIN{flag=0}{if($0 ~ /pending/){flag++}}END{if ( flag > 0 ) {exit 0} else {exit 1}}' );
I have a changed version in my monitor.sh script, and I'm wondering if maybe I messed it up:
Code:
while $( find $PWD -name configure.sh | awk 'BEGIN{flag=0}{if($0 ~ /"/root/configure.sh"/){flag++}}END{if ( flag = 0 ) {exit 0} else {exit 1}}' );
do
sleep 30
done
bash ~/configure.sh
What this is supposed to do is wait until configure.sh is transferred to it from a remote machine, and then execute configure.sh. I am wondering if the quotes in the if condition are throwing it off. Thoughts?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.