linux - Raspberry Pi, Dealing with Crontab -


i'm not familiar linux , it's first time using raspberry pi. trying set play mp3 file every day , came across using crontab viable option. i'm not sure how save files in correct location because every time write script using crontab can't seem save viable location...even writing new crontab desktop won't work. there more viable folder putting crontabs? again i'm new system help,

thank taking time read message.

you can type

crontab -e  

in command line , add file want run in 1 of lines. here's short overview on how write cronjob:

your cron:

 30 20 * * 1-5 omxplayer /home/pi/desktop/wakeupsong.mp3 

how setup cronjob in general:

 # * * * * *  command execute  # │ │ │ │ │  # │ │ │ │ │  # │ │ │ │ └───── day of week (0 - 6) (0 6 sunday saturday, or use names; 7 sunday, same 0)  # │ │ │ └────────── month (1 - 12)  # │ │ └─────────────── day of month (1 - 31)  # │ └──────────────────── hour (0 - 23)  # └───────────────────────── min (0 - 59) 

special characters in cron:

asterisk (*)

the asterisk indicates cron expression matches values of field. e.g., using asterisk in 4th field (month) indicates every month.

slash ( / )

slashes describe increments of ranges. example 3-59/15 in 1st field (minutes) indicate third minute of hour , every 15 minutes thereafter. form "*/..." equivalent form "first-last/...", is, increment on largest possible range of field.

comma ( , )

commas used separate items of list. example, using "mon,wed,fri" in 5th field (day of week) means mondays, wednesdays , fridays.

hyphen ( - )

hyphens define ranges. example, 2000-2010 indicates every year between 2000 , 2010 ad, inclusive.

percent ( % )

percent-signs (%) in command, unless escaped backslash (), changed newline characters, , data after first % sent command standard input.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -