Schedule tasks

Got a feature request? Great! Post your ideas here!
MikeG.6.5
Posts: 917
youtube meble na wymiar Warszawa
Joined: Fri May 15, 2015 1:56 am

Re: Schedule tasks

Post by MikeG.6.5 »

For starters the Busybox version doesn't support the @ metacommand. So doing @reboot or @yearly or @monthly doesn't work.

What I have found to do any kind of logging in your scripts is to look the thread that talks about logging here:

http://forum.asustor.com/viewtopic.php?f=49&t=1734

It basically tells you the syntax needed to add things into the system, file and connection logs. Then in your script called from cron you need to have some sort of error handling taking place, so if things work, it logs it, if it doesn't work, logs the error associated, in the system logs, so you can go in and find them.

If you have AiMaster installed on a phone or tablet, you can get the logs sent almost as soon as they are made. (Little bit of lag, maybe 10-15 seconds.)

I have this working for some of the scripts I put together for checking Plex and shutting down Plex, etc. I will start doing more with this as time permits. (Auto convert scripts for movies/TV shows, autoinport scripts, etc.) I'm hoping to have a script set up soon to tell me when someone starts streaming/transcoding a movie/show in Plex showing in the connection logs, as well as what movie/show they are watching. If they are synching I also want to see that in the connection logs. It means I'm going to have to modify a few existing scripts to get what I want it to do, and I hope it's going to be easy... With my luck, though...

As I've recently purchased a 7004T, I'm intending to put it to a lot more use than the little 202T I currently have. I hope to be able to set up a lot of the repetitive tasks involving moving data back and forth streamlined to a single set of auto scripts that should handle everything for me.
Jhinta
Posts: 39
Joined: Tue May 19, 2015 11:43 pm

Re: Schedule tasks

Post by Jhinta »

mkp wrote:+1

It would also be very helpful to be able to have cron log what it's doing (and view that log).

I'm having a heck of a time getting cron to do anything at all, and have not been able to get it to log anything either, so I don't know if there are any error messages. That makes it pretty hard to debug. :(

I also suspect the busybox-provided cron is more limited than the regular one - but if so in what way? What syntax does it / does it not support? Knowing that would help in debugging as well.
just do someting like this
01 14 * * * /home/joe/myscript >> /home/log/myscript.log 2>&1
0 15 * * * /home/joe/daily-backup.sh >> /var/log/cyphertite.log

and you have your log