To see if your script is running, try outputting things to a file during its execution, and open that file to see if it's indeed running.
Now, "B" is the issue, and we can fix it in 2 ways:
- Install cron on iPod
- Use launchd
I don't know if there's yet a cron port to the iOS
, so "1" might be a problem.
However, we can do "2", since launchd comes on iOS.
To use launchd, you need to create an XML plist file in [/Library/LaunchDaemons]
, do a couple of steps and that's it
Create the file [/Library/LaunchDaemons/com.scripts.myscript.plist]
and have its content as follows (in bold
what you need to change):
<?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”>
The key tags for the cron are follows:
They should be followed by an <integer>
tag, to specify their value.
If you don't specify a tag, it will be as if you used '*' in cron.
The plist file name can be whatever you want, mind you, so use what you think is logical.
Now, you need to let launchd know about your plist entry, so execute:
iPod:~ mobile$ launchctl load /Library/LaunchDaemons/com.scripts.myscript.plist
And it's done (hopefully)!
You can always check the launchctl man page