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


  Search this Thread
Old 06-05-2008, 09:13 PM   #1
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!
Old 06-05-2008, 09:32 PM   #2
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
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, 09:32 PM   #3
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:
$ 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, 09:48 PM   #4
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.



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 07:28 PM
How to see that crontab is running or not. nirmalraja Linux - General 1 11-23-2006 03:30 AM
error running script on crontab haora Linux - Newbie 3 03-11-2005 05:02 PM
Shell script running via crontab problem. thetruethugg Linux - Software 13 12-19-2003 09:56 PM
Old Crontab still Running vwaldoguy Linux - Software 3 08-05-2003 03:50 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:27 PM.

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