Crontab - Detailed Questions
With all the help from this group I now have Crontab working, but have a few more detailed questions.
1. is there any limit to how many individual Crontabs can be entered at once? Here is a 2 line example Code:
30 8 * * * sh vida 2. If those 20 lines are entered and then the Rpi is shut down overnight will all the data be retained. Or would it be required that the next 16 would have to be reentered after a reboot the following morning. I have found that if i use a script as below that the FireFox line will open without any problem, apparently because the OMXplayer closes at the end of the video. However if the Firefox is run before the OMXplayer then the the FireFox must be shutdown before the OMXplayer can start. Code:
#!/bin/bash 4. I have tried to get the email sent to my address at home. I added the following as the first line below the shebang in my script. ____ MAILTO=xyz@bellsouth.net But I did not get any email. Otherwise the script would be the same as in the second code box without the firefox Thanks! |
Quote:
Quote:
Quote:
Quote:
Quote:
|
crontab is a program used to maintain crontab files. No limit on how many you can enter. Depending on what version of cron is running there could be a limit on the total number of cron jobs but 20 is not a problem. No problem with shutting down the Pi but jobs will not automatically run if you start it back up after a scheduled time.
Many ways to kill a process. You can use pkill, killall, pgrep commands You can use pidof to find the PID of a running process. |
Quote:
Here is a 2 line example Code:
30 8 * * * sh vida 2. If those 20 lines are entered and then the Rpi is shut down overnight will all the data be retained. Or would it be required that the next 16 would have to be reentered after a reboot the following morning. I have found that if i use a script as below that the FireFox line will open without any problem, apparently because the OMXplayer closes at the end of the video. However if the Firefox is run before the OMXplayer then the the FireFox must be shutdown before the OMXplayer can start. Code:
#!/bin/bash 4. I have tried to get the email sent to my address at home. I added the following as the first line below the shebang in my script. ____ MAILTO=xyz@bellsouth.net But I did not get any email. Otherwise the script would be the same as in the second code box without the firefox Thanks! |
Why did you copy your original post? Did you read the replies?
What do you not understand? |
Sorry
Quote:
I did read them all but was trying to understand How to use the Quote Box. Thanks again, I think I understand what was sent, with a small exception that I was going to experiment with. If I use the killall in a script in crontab to kill the firefox before running the next omxplayer. Would that kill the crontab also? |
No it will not.
|
If you prefaced your omxplayer script with a line like
(treat the following as pseudocode) kill $(ps aux | grep [f]irefox | awk '{print $2}') 9 && sleep 10 and if you only have a single instance of firefox running at that time, it should zap it prior to omxplayer starting up Quote:
Hope that helps |
Code:
$(ps aux | grep [f]irefox | awk '{print $2}') Code:
$(pidof firefox) |
:doh:
Doesn't work on Unix systems and therefor, not Posix compliant ? ( I don't have a Solaris node handy at the moment, I'm just guessing here...) :hattip: |
pidof is actually a link to killall5. It's been a long time since I've played with Unix...
|
Everytime I feel like I see the light at the end of the tunnel I find that it really is just a hole before starting the next tunnel. but THANK You all for your help!
I will include 2 scripts That I ran with crontab on 2 lines a minute apart. The first is the script that I setup to run my video and when it was finished open firefox. But I found that that needed a way to shut firefox down. My solution one Code:
#vidb To play video from a script Code:
#vidd3 To play video from a script with killall Is the problem somehow related to the display function? |
All times are GMT -5. The time now is 04:37 AM. |