LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2010, 03:45 AM   #1
dhirendrs
Member
 
Registered: Nov 2009
Posts: 45

Rep: Reputation: 15
Cron job is not running


Dear all,

i am executing the script.

with help of cron job but it is not executing in cron job.

i check owner and chmod and create the file and execute manually it is working fine but in cron job i set below

Crontab -e

8 14 * * * /home/tplinux/webapp/tpadminhost/collect_ejxml/ejrename.sh

wq!

after that wait till that time but script is giving message no such file in directory but same thing is excute manually it is running fine and found the files.
Below is my script details
file name ejrename.sh.

#########################################################################
# Change in GP XML file format
# DATE : 22-JULY-2010
# CREATED BY : DHIREN SHAH
# VERSION : 1.0
# EXECUTION USER : tux
# METHOD OF EXECUTION : ejrename.sh
# sh ejrename.sh
##########################################################################
#! /bin/sh
for THIS in hid*.2[0-9]*.[0-9]*.[0-9]*.xml; do echo ${THIS} | awk -F. '{ print "mv "$0" "$1"."$2"."$3"."$6 }' | bash ; done
 
Old 08-25-2010, 04:37 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Try changing to the directory where the files are located, in the script.

Code:
#! /bin/sh
cd /path/to/files
for THIS in hid*.2[0-9]*.[0-9]*.[0-9]*.xml; do echo ${THIS} | awk -F. '{ print "mv "$0" "$1"."$2"."$3"."$6 }' | bash ; done
 
  


Reply



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
Cron Job is not running akshathajagadish Linux - Newbie 2 10-15-2009 07:21 PM
Running a Cron Job landysaccount Linux - Newbie 6 02-04-2009 05:29 PM
cron job not running vincebs Linux - Software 34 10-30-2004 01:27 PM
Cron job not running? james_cwy Linux - Newbie 6 12-14-2003 08:24 PM
Cron Job Not Running pzorn Linux - General 4 10-02-2003 01:38 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:00 PM.

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