cron on JB ipad

Discussion in 'iPad Hacking' started by dksill, Jul 15, 2011.

  1. dksill
    Offline

    dksill iPF Noob

    Joined:
    Jul 15, 2011
    Messages:
    4
    Thanks Received:
    1
    Trophy Points:
    0
    Ratings:
    +1 / 0
    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.
  2. dksill
    Offline

    dksill iPF Noob

    Joined:
    Jul 15, 2011
    Messages:
    4
    Thanks Received:
    1
    Trophy Points:
    0
    Ratings:
    +1 / 0
    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.
  3. dksill
    Offline

    dksill iPF Noob

    Joined:
    Jul 15, 2011
    Messages:
    4
    Thanks Received:
    1
    Trophy Points:
    0
    Ratings:
    +1 / 0
    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 username@myserver.com '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!
    • Like Like x 1
  4. canoock
    Offline

    canoock iPF Noob

    Joined:
    Jun 4, 2012
    Messages:
    1
    Thanks Received:
    0
    Trophy Points:
    0
    Ratings:
    +0 / 0
    Great post - it works

Share This Page

Search tags for this page
bash
,

cron for ipad

,

cron ipad

,

cron iphone

,
cronjobs in ipad
,
crontab job ipad
,
how to do cron jobs on ipad
,
ios crontab
,
ios jb how to use cron
,

ipad cron

,

ipad cron job

,

ipad crontab

,

iphone cron