LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-05-2008, 08:13 PM   #1
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Rep: Reputation: 33
Running a script with crontab.


Hello again!

I have a script which records tv from the tv tuner card. Its name is tape (/home/myuser/bin/tape). Its format is: tape <Channel> <Name> <duration>

If I run it from terminal, it works ok. /bin is already added to $PATH so I can run the script from any other directory.

Now, I would like to create a cron job. For instance, to record a TV program starting at 21:00 (9pm). How do I have to do to add this job to cron? In Ubuntu I used to add the job with crontab -e and then (inside cron) I could write something like this:

00 21 * * 1-5 bin/tape 20 Voyager 01:00:00

Is this possible under Slackware? If so, How?

Thanks again folks!
Glore2002.-
 
Old 06-05-2008, 08:32 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
You would do it the same way. Cron is not part of Ubuntu, it is a standard daemon among all Linux distributions.
 
Old 06-05-2008, 08:32 PM   #3
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
The exact same thing could be done -- however, I would suggest using an absolute path to /home/myuser/bin/tape instead of a relative path. Although /bin is in your $PATH, /home/myuser/bin will not be unless you added it manually to your $PATH (and even if you did, your $PATH will not survive a reboot, so you'd have to create an entry in ~/.bashrc to add the directory to your $PATH). I also think it's just not worth it when you can just use an absolute reference. Something like the following would do nicely:
Code:
$ crontab -l
00 21 * * 1-5 /home/myuser/bin/tape 20 Voyager 01:00:00
Assuming, of course, that your script can do something useful with the arguments provided (I'm assuming it tapes Voyager on channel 20 for one hour). `crontab -e` will let you edit your crontab, just as in Ubuntu.
 
Old 06-05-2008, 08:48 PM   #4
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Smile Thanks!

Problem solved! Thanks friends for your valuable help.

Glore2002.-
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script not running within crontab job WrightExposure Linux - General 3 01-23-2007 06:28 PM
How to see that crontab is running or not. nirmalraja Linux - General 1 11-23-2006 02:30 AM
error running script on crontab haora Linux - Newbie 3 03-11-2005 04:02 PM
Shell script running via crontab problem. thetruethugg Linux - Software 13 12-19-2003 08:56 PM
Old Crontab still Running vwaldoguy Linux - Software 3 08-05-2003 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration