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.
if [ -z "$TEST" ]
then
pptp xxx.xxx.xxx.37 call testVPN_original
fi
echo $TEST
SUB=${TEST:0:3}
YY="ppp"
echo $YY
echo $SUB
if [ $SUB == $YY ];
then
ping -c 2 192.168.0.2
route add default gw 192.168.0.2
fi
and named it as "redial" and set permission chmod u+x redial (chmod 755 redial)
ls -l
-rwxr-xr-x 1 root root 287 Jan 21 00:19 redial
I save this file in /etc/crond.d/redial
manually this script is running correctly but when I add this script to crontab it never runs. following is my crontab file.
1) Near the end of your post, you list some FOLDERS, not files. And I don't believe the cron program you are using, actually cares what the names of those folders are; they are more for your convenience than for the cron program.
2) What cron program are you using? I am assuming Dillons Cron, but if I'm wrong, please tell us. If it is Dillons (which I use), I don't see in the man pages any reference to a "cron.allow" or 'cron.deny' file or folder. Are you sure this is relevant?
3) It looks like a simple permissions issue. I wonder if the fact that you have the "/bin/sh" on the crontab line is causing the problem. Dillons Cron executes commands using "/bin/sh -c" already, so putting /bin/sh there (considering that you already have a shabang atop your script anyway) may be the problem.
First thing I'd do, would be remove the /bin/sh from the crontab entry.
Sasha
Last edited by GrapefruiTgirl; 01-27-2010 at 02:17 AM.
Reason: typo
1) cron.deny is file not directory
2) I'm not sure which cron program I'm using because I'm using CentOS 5 and cron is pre-installed.
3) yes remove /bin/sh from cron now it looks like following
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.