What's new

cron on JB ipad

dksill

iPF Noob
Hi, my very first post after jailbreak ipad2.

Is there something like cron / crontab available - scheduling bash script? I'd like to deposit my ip address on my server.

This helps also to set up a tunnel automatically to get back into the device.

Last not least i'd like to deposit the ip or real location in case it bets lost.

Cheers, dksill.
 
crontab -> launchd

THIS IS A DUMMY RESPONSE

Gents, they don't let me post links and so on, since I am a newbie. With this I have 3 logs and I will be able to do so.
 
Ok, gentlemen,

found the solution by myself: the crontab / cron feature is implemented in launchd, see the man pages:

Loading…

The StartInterval parameter gives the delay time - alternatively the cron-like timing can be defined in StartCalendarInterval.

I made a file named: com.DkSill.SendHostStart.plist and linked it into /System/Library/LaunchDaemons/

the file /usr/bin/sendhost.sh contains my bash script with whatever i like to do.

here the plist file:

===========================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.DkSill.SendHostStart</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/sendhost.sh</string>
<string>parameter1</string>
<string>parameter2</string>
</array>
<key>Nice</key>
<integer>20</integer>
<key>StartInterval</key>
<integer>1777</integer>
</dict>
</plist>
================================

and here a script file deposing my actual TCP/IP address onto my web server:

================================
#!/bin/bash
date >> /var/mobile/sendhost.log
ssh -i /var/mobile/.ssh/id_rsa [email protected] 'echo `date +20%y.%m.%d.%H.%M` `echo $SSH_CLIENT | cut -f 1 -d \ ` >> ~/www/tcp-log/ipad.txt'
================================

Like this, I can track where the device is connected. if it gets stolen, then at least i will get this info.

in a next step, it would be cute to work out the gps coordinates of where the device is...

have fun!
 

Most reactions

Latest posts

Back
Top