LinHES Forums
http://forum.linhes.org/

DCRON Usage
http://forum.linhes.org/viewtopic.php?f=25&t=24106
Page 1 of 1

Author:  Bob [ Thu Dec 04, 2014 3:11 pm ]
Post subject:  DCRON Usage

Hi,

I have a bin bash file to execute each night to get my electronic EPG. Actualy a start it manually each 2-3 days.

What is the correct way to add it to the DCRON daily task. Should i use the mythtv user or root?

I'm not linux expert and i'd like to have a complete how to.

By the way Linhes 8.2 is simply Fantastical !!

Thanks
Bob

Author:  brfransen [ Thu Dec 04, 2014 3:19 pm ]
Post subject:  Re: DCRON Usage

Open a xterm or ssh in and run
Code:
sudo cp /path/to/yourBashFile.sh /etc/cron.daily/

Author:  graysky [ Thu Dec 04, 2014 4:42 pm ]
Post subject:  Re: DCRON Usage

brfransen wrote:
Open a xterm or ssh in and run
Code:
sudo cp /path/to/yourBashFile.sh /etc/cron.daily/


Or you can add it to your user's crontab (assuming it will run as your user and not as the root user:
Code:
crontab -e


The syntax is a little tricky, I recommend you google for some guides. For example, http://www.pantz.org/software/cron/croninfo.html

Here is a quick cheat sheet:
Code:
#     *     *   *    *        command to be executed
#-     -     -   -    -
#|     |     |   |    |
#|     |     |   |    +----- day of week (0 - 6) (Sunday=0)
#|     |     |   +------- month (1 - 12)
#|     |     +--------- day of month (1 - 31)
#|     +----------- hour (0 - 23)
#+------------- min (0 - 59)

# to run once daily you may use a shortcut
@daily /path/to/yourBashFile.sh

# or you can do it the old school way
# run on the 0 min of the 23rd hour
0 23 * * * /path/to/yourBashFile.sh

Author:  mattbatt [ Thu Dec 04, 2014 6:49 pm ]
Post subject:  Re: DCRON Usage

Do either of these ways survive an upgrade or will they be overwritten?

Author:  brfransen [ Thu Dec 04, 2014 7:36 pm ]
Post subject:  Re: DCRON Usage

They both would survive a command line (pacman -Syu) upgrade. Neither method would automatically survive an ISO upgrade but the /etc/cron.daily method would be in the backup for manual restoration.

Author:  graysky [ Fri Dec 05, 2014 11:59 am ]
Post subject:  Re: DCRON Usage

brfransen wrote:
They both would survive a command line (pacman -Syu) upgrade. Neither method would automatically survive an ISO upgrade but the /etc/cron.daily method would be in the backup for manual restoration.


Maybe mod the backup script to hit /var/spool/cron?

Author:  Bob [ Sun Dec 07, 2014 3:18 pm ]
Post subject:  Re: DCRON Usage

I used the simple:
Code:
sudo cp /path/to/yourBashFile.sh /etc/cron.daily/


There was a glitch in my code (relative path error :? ) I think it's fixed now. Will see tomorrow.

It's a good idea to backup the Dcron private schedule and script.

Thanks

Bob
:D

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/