Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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 am building a small unit, based on a Raspberry Pi, to control central heating using a fairly complicated schedule in a building with no wired Internet access.
I am using the Sakis3g script to control a USB GSM dongle (O2, but actually a Huawei dongle).
When I use the sakis3g script standalone, it works fine (everything done as root):
root@raspberrypi:~# ./sakis3g connect APN=m-bb.o2.co.uk
E160 connected to O2 - UK (23410).
root@raspberrypi:~#
But - when I try to run the sakis3g command from within a script executed from cron, it simply doesn't do anything (it just executes for 2-3 seconds and that's it - nothing happens).
Output from /var/log/syslog:
Jan 18 11:26:01 raspberrypi CRON[5302]: (root) CMD (/root/networkon.sh)
Jan 18 11:26:04 raspberrypi CRON[5298]: (CRON) info (No MTA installed, discarding output)
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
21 * * * * /root/networkon.sh
^ it might help, but it might not.
i had some experience with sakis3g some time ago.
i came to the conclusion that it's a horrible mish-mash of scripts cludged together with hotsnot. no idea how it will behave when called form cron (i did indeed have a similar problem with it).
it's good because ~10years ago it was able to recognize simply everything, and connect.
but nowadays, i don't know if it's even maintained anymore.
if you can, don't use it.
Thanks, TenTenths, in fact I did have the full path to sakis3g (the line in the post was a cut-and-paste error).
You are right, Ondoho - it is a terrible mish-mash - but in fairness it DID download and immediately work with my modem/carrier combination (O2) and I had it running standalone within 5 minutes, it just wouldn't work from cron.
BUT - I have now got to the bottom of it - after much digging around!
For some bizarre reason I don't understand (because the whole thing is running as root anyway) one has to add the "--sudo" line to the command before it will work from cron, i.e.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.