LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-06-2004, 09:31 AM   #1
visu
LQ Newbie
 
Registered: Jan 2004
Posts: 25

Rep: Reputation: 15
problem in shell scripting


Hello all,
I have problem in my backup script (backup.home)
The following line in backup.home script file

/usr/local/bin/growisofs -Z /dev/cdrom1 /backup/*.dar this line included in one script called backup.home

if i run backup.home in console that line just ignore warnings and running

but if i place backup.home in cron job then that line give error

Anyone have any idea about my problem ?

Thanx in advance
 
Old 01-06-2004, 09:45 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
What is the error???

If your script generates output and doesn't have a terminal, things can go wrong. This could be your problem (running from the commandline, you have a terminal. If run from cron, you don't have a terminal). But all this is just a guess, 'cause you don't tell us what is going wrong.
 
Old 01-06-2004, 10:05 AM   #3
visu
LQ Newbie
 
Registered: Jan 2004
Posts: 25

Original Poster
Rep: Reputation: 15
Hello thanx for ur response.

Actually the script is for daily backups in DVD+RW media. So i am using growisofs to write the backups file which comes out from DAR tool to DVD+RW media. Backup files extension has .dar

Backup script name is "backup.home" it contains the following line to write the backup files in DVD+RW media.

/usr/local/bin/growisofs -Z /dev/cdrom1 /backup/*.dar

Actually inserted DVD+RW media has already datas. But every time this script overwrites the current backup files to DVD+RW media, so exisiting datas out and writing current datas in media.

this works fine if DVD+RW media has no exisit datas and also with datas if run this script from console like ./backup.home

But this script wont write datas in DVD+RW media if place this script in cron job.

i want to know how to write this line

/usr/local/bin/growisofs -Z /dev/cdrom1 /backup/*.dar

to ignore warnings and error this growisofs continuous to write datas in DVD+RW media.

I hope now u understand my probs.

Hope u have some idea about it.

regards,
visu
 
Old 01-06-2004, 12:03 PM   #4
computergeek84
Member
 
Registered: Nov 2003
Location: /dev/null
Distribution: Gentoo, Ubuntu
Posts: 61

Rep: Reputation: 15
Does this command

/usr/local/bin/growisofs -Z /dev/cdrom1 /backup/*.dar

produce any output to stdout or stderr (text you see on the screen)?


If so, then try this for your cron job:

/usr/local/bin/growisofs -Z /dev/cdrom1 /backup/*.dar > /dev/null 2>&1

to throw away all the text it would print in the terminal and redirect the filestreams into the bit bucket. This may be the reason that it works in the terminal but not in cron.
 
Old 01-06-2004, 04:16 PM   #5
visu
LQ Newbie
 
Registered: Jan 2004
Posts: 25

Original Poster
Rep: Reputation: 15
Hello computergeek84
Thanx for ur reply. The following command which u mentioned, just says no error, but it will not do its job, just come out of this growisofs command.

/usr/local/bin/growisofs -Z /dev/cdrom1 /backup/*.dar > /dev/null 2>&1

But i am happy now bcs the following dirty trick command works for me now

/usr/local/bin/growisofs -Z /dev/cdrom1 /backup/*.dar < /dev/tty13

It works fine with warnings message in cron job.

Thanks for friends who helped me out.

regards
visu
 
  


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
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
Shell scripting problem for importing Firefox files montylee Programming 6 06-03-2005 01:52 AM
shell scripting: variable problem XST1 Programming 7 01-30-2005 01:45 PM
another cgi and shell scripting problem + webserver prinski Programming 6 04-08-2004 04:25 PM
Shell Scripting Problem linuxboy69 Linux - Software 2 03-31-2004 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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