LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-10-2006, 10:46 AM   #1
spiffytech
Member
 
Registered: Dec 2005
Location: NC, USA
Distribution: (K)ubuntu
Posts: 139

Rep: Reputation: 15
Script creats temporary files... Cron won't run it


I've written a script, and part of the script involves writing temporary files. When I'm in the /home/me directory, where the script is stored, it runs fine. However when I try to run it from any other directory, it does not work properly because it can't make the temporary files. How can I get around this problem?
 
Old 01-10-2006, 11:29 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
You probably don't have write access to another directory. Since it is a temporary file, use the /tmp directory. That's what it is there for.
 
Old 01-10-2006, 12:06 PM   #3
spiffytech
Member
 
Registered: Dec 2005
Location: NC, USA
Distribution: (K)ubuntu
Posts: 139

Original Poster
Rep: Reputation: 15
I tried replacing all of the "> file" with "> /tmp/file" and it didn't seem to work.
 
Old 01-10-2006, 12:31 PM   #4
ask.jackal
LQ Newbie
 
Registered: Jan 2006
Location: India
Distribution: Suse
Posts: 12

Rep: Reputation: 0
Try executing the script with "-x" option(Assume its a shell script) and it should give u more info. Also make sure that any other writes (not temp files) should be having fully qulified paths and not relative paths.

~Jackal
 
Old 01-10-2006, 01:54 PM   #5
spiffytech
Member
 
Registered: Dec 2005
Location: NC, USA
Distribution: (K)ubuntu
Posts: 139

Original Poster
Rep: Reputation: 15
Where would I use the -x option in executing the script? I've tried "/home/me/script -x" and it doesn't tell me anything new.
 
Old 01-11-2006, 10:03 AM   #6
ask.jackal
LQ Newbie
 
Registered: Jan 2006
Location: India
Distribution: Suse
Posts: 12

Rep: Reputation: 0
try "sh -x /home/me/script"
 
  


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
FTP Script will not run from Cron grhansen Programming 12 01-13-2006 04:13 AM
run shell script on cron varunbihani Linux - Newbie 5 07-08-2005 01:50 AM
can't get cron to run my script. dr_zayus69 Linux - Software 6 04-12-2005 06:34 PM
howto run a script from cron every 5 minutes except 11pm-8am ? cccc Programming 2 03-20-2005 03:52 AM
shell script fo run auto job in cron JolynnMarie LinuxQuestions.org Member Intro 0 04-28-2004 11:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:10 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