Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-06-2004, 09:31 AM   #1
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
LQ Veteran
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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
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.

Old 01-06-2004, 12:03 PM   #4
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
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.



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
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

All times are GMT -5. The time now is 12:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration