Run a Script after Login

Started by cdusseau, October 28, 2010, 20:11:23 PM

Previous topic - Next topic

cdusseau

I am writing a simple script to autoupdate some files on a usb drive from a network share. I need this script to run right after login and the connection to the network is up.

I honestly am not that familiar with any sort of task scheduling in Linux, but I already tried rc.local and it executes it too early (before net connection is up).

I can't find a cron (the fact that Im looking for one might speak to my ignorance) and I'm not sure how to use the rc.d system if that would work for me.

I know this is something a lot of you consider common knowledge, so please take a minute and help me out =)

Thanks.

Elmar

hi,
Quote from: cdusseau on October 28, 2010, 20:11:23 PM
I honestly am not that familiar with any sort of task scheduling in Linux, but I already tried rc.local and it executes it too early (before net connection is up).

the network is started with rc.local. place your script at the end of rc.local and it should work

regards
elmar

cdusseau

I tried that and got this as a result:

Connection to image-server failed (Error NT_STATUS_BAD_NETWORK_NAME)

But, if I execute the exact same script after login it connects and performs its function just fine. I said I was having issues with the connection not being ready because after the autologin I get a few lines about eth0. They tell me a few things about the link being ready, not ready and then ready again. After it becomes ready the second time my script works great.

Any way to delay the execution until the network is up? Aka detect if link is down or up and keep trying until it is up.

Elmar

you can check it with dmesg|grep "eth0: link becomes ready" in a while loop

cdusseau

Thanks for the input, its working great now.

BTW I truly love this distribution, its perfect for my needs!

Elmar

nice to hear that its useful :)

best regards
elmar