View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 7 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: DCRON Usage
PostPosted: Thu Dec 04, 2014 3:11 pm 
Offline
Joined: Thu Sep 08, 2005 4:46 pm
Posts: 81
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


Top
 Profile  
 
 Post subject: Re: DCRON Usage
PostPosted: Thu Dec 04, 2014 3:19 pm 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 1017
Location: SC
Open a xterm or ssh in and run
Code:
sudo cp /path/to/yourBashFile.sh /etc/cron.daily/


Top
 Profile  
 
 Post subject: Re: DCRON Usage
PostPosted: Thu Dec 04, 2014 4:42 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1995
Location: /dev/null
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

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject: Re: DCRON Usage
PostPosted: Thu Dec 04, 2014 6:49 pm 
Offline
Joined: Tue Aug 15, 2006 11:14 am
Posts: 1198
Location: Orlando FL
Do either of these ways survive an upgrade or will they be overwritten?

_________________
My System


Top
 Profile  
 
 Post subject: Re: DCRON Usage
PostPosted: Thu Dec 04, 2014 7:36 pm 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 1017
Location: SC
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.


Top
 Profile  
 
 Post subject: Re: DCRON Usage
PostPosted: Fri Dec 05, 2014 11:59 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1995
Location: /dev/null
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?

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject: Re: DCRON Usage
PostPosted: Sun Dec 07, 2014 3:18 pm 
Offline
Joined: Thu Sep 08, 2005 4:46 pm
Posts: 81
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


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: Baidu [Spider] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu