Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,769,355 Members 39,569 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Run crond from init.d

Tip us?
 
Jaman42
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 10
Join Date: Apr 2014
Default [Q] Run crond from init.d

Hi,
I have a Radxa Rock on which I am running Android 4.2.2, I am trying to get cron working to schedule some scripts to run.

I have got init.d working to launch a script at boot but I can't seem to be able to start crond from it. I have installed SSHDroid on the unit so I can putty to it, if I putty to the device and run
Code:
crond -b -c /data/crontab
cron starts and everything is running fine.

But when I add
Code:
crond -b -c /data/crontab
to my init.d script nothing happends and I can't seem to figure out why.

This is the full contents of my init.d script:
Code:
#!/system/bin/sh
# Init.d test

if [ -e /data/Test.log ]; then
rm /data/Test.log
fi

echo  Init.d is indeed working !!! >> /data/Test.log
echo "excecuted on $(date +"%d-%m-%Y %r" )" >> /data/Test.log

crond -b -c /data/crontab
What am I doing wrong?
 
es0tericcha0s
Old
#2  
Senior Member
Thanks Meter 487
Posts: 2,519
Join Date: May 2010

 
DONATE TO ME
Can't say this is my forte, but maybe something from this thread can get you pointed in the right direction: http://forum.xda-developers.com/show....php?t=2090284
Need some help, advice, something fixed? Hit me up on Hangouts @ es0tericcha0s and check out my site: http://mobilemojo5280.com for more info!


HTC Droid Eris / Motorola Droid / Samsung Galaxy S Fascinate / Motorola Droid X / LG G2x / HTC Evo 3D (x2) / Samsung Epic 4G Touch (Sprint S2) / HTC Amaze / Samsung Galaxy S3 (International) / Samsung Galaxy Note 2 / Nexus 4 / HTC One / Samsung Galaxy S4 / Sony Xperia ZL / Nexus 5 / OnePlus One (64 GB)
 
Jaman42
Old
#3  
Junior Member - OP
Thanks Meter 0
Posts: 10
Join Date: Apr 2014
Thank you for your answer

I tried updating and using the full path to the crond but that wasn't working either. Then I realized that it wasn't working via putty either with full path. My conclusion was that I was using the wrong path, found out I could run "which crond" to find the correct path which was completely different. In my case "/data/data/berserker.android.apps.sshdroid/home/.bin/crond -b -c /data/crontab" was the full path and now it's working just fine.
 
es0tericcha0s
Old
#4  
Senior Member
Thanks Meter 487
Posts: 2,519
Join Date: May 2010

 
DONATE TO ME
Cool. Glad you're on the right track!
Need some help, advice, something fixed? Hit me up on Hangouts @ es0tericcha0s and check out my site: http://mobilemojo5280.com for more info!


HTC Droid Eris / Motorola Droid / Samsung Galaxy S Fascinate / Motorola Droid X / LG G2x / HTC Evo 3D (x2) / Samsung Epic 4G Touch (Sprint S2) / HTC Amaze / Samsung Galaxy S3 (International) / Samsung Galaxy Note 2 / Nexus 4 / HTC One / Samsung Galaxy S4 / Sony Xperia ZL / Nexus 5 / OnePlus One (64 GB)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes