LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-09-2010, 09:23 AM   #1
tingon
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Rep: Reputation: 0
growisofs + cron problem


Hi to all



i make a script to automate burning backup files on dvd
it works fine if i start it from root user, but if i start it
from cronjob do noting...
i try on growisofs the option -use-the-force-luke=force but nothing happens

i check the env of cron
_______________________________
HOME=/root
LOGNAME=root
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PWD=/root
SHELL=/bin/bash
SHLVL=1
XDG_SESSION_COOKIE=3e0d70f7b71074a0b1fff4bb4aa97d13-1281297181.926502-724038309
_=/usr/bin/env
________________________________

and it seems ok i've got my script in /usr/local/bin and growisofs in /usr/bin



code of my script below
___________________
#!/bin/bash
bkup_path='/bkrepo/';
prefix='PAR*';
totdimfile=0
for FILE in $(/bin/ls -r $bkup_path$prefix)

do
dimfile=`/bin/ls -l $FILE | /usr/bin/awk -F " " '{print $5}' `
let "totdimfile += dimfile";

if [ "$totdimfile" -lt "4700000000" ]
then
NAMEFILE=`/bin/ls -l $FILE | /usr/bin/awk -F " " '{print $8}' `
ALLNAMEFILE="$ALLNAMEFILE $NAMEFILE";
fi
done
/usr/bin/growisofs -use-the-force-luke=force -Z /dev/scd0 -R -J $ALLNAMEFILE
/usr/bin/growisofs -M /dev/scd0=/dev/zero
/usr/bin/eject
_________________________
end code of my script


if someone has make growisofs working with cron, please thellme howto please.... i'm a week over this problem and i can't solve it.

every help is appreciated.

(excuse for my buggy english)

Andrea Cumini
Verona Italy
 
Old 08-09-2010, 12:23 PM   #2
tingon
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Original Poster
Rep: Reputation: 0
solved

Solved!!!

for anyone has this problem….
i fix the script and now works fine!!

i fix the row with growisofs as described in this post

http://lists.debian.org/cdwrite/2003/10/msg00023.html

and i realize that i've got another problem, i use ls and awk in my script
to retrieve the name of file and the size of file.


this is the output of ls launched of cronjob

root@db:/# cat /tmp/dd.txt
-rw-r--r-- 1 nicola root 848860160 Aug 3 06:11 /bkrepo/PAR_20100802LUN.gz

see the date i … 2 fields,

this is the output of ls launched from interactive shell


root@db:/# ls -l /bkrepo/PAR_20100802LUN.gz
-rw-r--r-- 1 nicola root 848860160 2010-08-03 06:11 /bkrepo/PAR_20100802LUN.gz

here the date only one field,


with awk from cronjob i must retrieve the name of the file with {print $9} instead of {print $8}

i bet the locale from cronjob is different than the interactive shell….i must investigate
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with growisofs RemusX2 Linux - Software 2 01-14-2009 07:50 PM
growisofs question/problem eagle63 Linux - Newbie 2 12-23-2005 07:55 PM
growisofs problem scng Linux - Software 1 10-07-2005 07:38 PM
growisofs with cron pete_g Linux - Software 1 07-21-2004 04:54 PM
Problem with K3b and growisofs Machinegun Linux - Software 0 07-06-2004 03:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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