Post Reply

[Q] Run crond from init.d

OP Jaman42

14th April 2014, 06:36 AM   |  #1  
OP Junior Member
Thanks Meter: 0
 
10 posts
Join Date:Joined: Apr 2014
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?
14th April 2014, 08:18 AM   |  #2  
Senior Member
Thanks Meter: 563
 
2,957 posts
Join Date:Joined: May 2010
Donate to Me
More
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
14th April 2014, 08:53 AM   |  #3  
OP Junior Member
Thanks Meter: 0
 
10 posts
Join Date:Joined: 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.
14th April 2014, 08:57 AM   |  #4  
Senior Member
Thanks Meter: 563
 
2,957 posts
Join Date:Joined: May 2010
Donate to Me
More
Cool. Glad you're on the right track!
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android Q&A, Help & Troubleshooting by ThreadRank