Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 7th August 2012, 03:34 PM
tjordan Offline
Registered User
 
Join Date: Aug 2012
Location: Virginia
Posts: 2
windows_xp_2003firefox
problem executing script in crontab with arguments

Hi,
I'm having issues running a certain shell script in crontab. I've narrowed down the problem to the arguments that I'm trying to provide to the shell script. The first argument is a date YYYYMMDD and the second argument is a file. The shell script executes fine with the arguments when I run it manually from cli. If I remove the arguments and run from crontab, the script executes, but no output because I need the arguments. Here is what I'm using right now...

Code:
 08 09  *  *  *  tjordan /home/tjordan/HWinventory_Box.sh $(date '+%Y%m%d') /home/tjordan/hostnames
So I'd like to know how I need to format this job so it will run with the arguments.

Thanks
Reply With Quote
  #2  
Old 7th August 2012, 03:49 PM
saqer Offline
Registered User
 
Join Date: Oct 2006
Posts: 177
linuxfirefox
Re: problem executing script in crontab with arguments

You must escape the % character:
Code:
 08 09  *  *  *  tjordan /home/tjordan/HWinventory_Box.sh $(date '+\%Y\%m\%d') /home/tjordan/hostnames
Reply With Quote
  #3  
Old 7th August 2012, 05:23 PM
tjordan Offline
Registered User
 
Join Date: Aug 2012
Location: Virginia
Posts: 2
windows_xp_2003firefox
Re: problem executing script in crontab with arguments

That was it, running great now. Thanks!
Reply With Quote
Reply

Tags
arguments, crontab, executing, problem, script

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing a shell script in GUI foampile Using Fedora 0 4th April 2012 07:41 AM
[SOLVED] Problem with crontab script spiketailz Programming & Packaging 10 8th September 2011 07:41 AM
[SOLVED] Executing a Bash Script On Optical Disc Mount atavus Programming & Packaging 3 23rd February 2010 02:29 AM
PHP script not executing on HTTPD ridetehpenguin Servers & Networking 4 14th March 2008 03:25 AM
Executing shell script without dialog box? Elias Using Fedora 3 27th June 2005 08:47 AM


Current GMT-time: 23:38 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat