LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-18-2003, 08:41 AM   #16
steltner
LQ Newbie
 
Registered: May 2003
Posts: 18

Original Poster
Rep: Reputation: 0

I'm realy sorry but I'm a newbie and I can interpret your suggestion:

"some_command 2>&1 > logfile".

I tried many combination, but may you can give me some more details - I promise I will read the manuals later, but I would like get a solution today for the compression job ;-))

During this request is on the way I will have a look in the UNIX-manuals ;-)

Many TNX!
 
Old 05-18-2003, 09:12 AM   #17
steltner
LQ Newbie
 
Registered: May 2003
Posts: 18

Original Poster
Rep: Reputation: 0
I tried

sh -x compress3.sh password /data/pictures/index/bmp/1999 1999.103 2>&1 > log.txt

it's working, but the output is the same as I sent before. The "sh -x ..." debug informations are missing. I checked the archive file and I found it in the /data/pictures/_batches directory as ?.rar!!!
 
Old 05-18-2003, 10:58 AM   #18
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Removing quotes around the ${files} variable in line /opt/rar/rar ${rar_opt} "${rarfile}" "${files}" should do: Mea Culpa.

If you've got a "?.rar" then you used wildcards you didn't show on the commandline you posted, because the filename is taken directly from variable "$3", so your commandline probably read "sh -x compress3.sh password /data/pictures/index/bmp/1999 ? 2>&1 > log.txt". Like I said before, this was a quick hack and based on the files using some kind of naming scheme, like (4-digit year).(number).(extension). I also told you it doesn't do input validation, meaning if *you* fsck up, the script will fsck up (dunno how to tell it more politely while remaining clear, ok).

If you found it in the different dir, then the source dir you gave to the script is different, because the base dir variable "base" is taken from separating the path (var "$2") and turning it into array elements (var "src"). Example, if you have a path /data/pictures/index/bmp/1999, the array "src" would look like " data pictures index bmp 1999 " (spaces intended), and var "base" takes the first three elements, so var "base" will be "/data/pictures/index", so the "rardir" variable will always follow as the subdir from "base". You can change the "depth" the archive will be stored as adding or deleting elements from the "base" var.
 
Old 05-18-2003, 02:27 PM   #19
steltner
LQ Newbie
 
Registered: May 2003
Posts: 18

Original Poster
Rep: Reputation: 0
Ok, I deleted the quotes and I see that the src[x] usage may a error, but now I changed the last line in the script to:

/opt/rar/rar ${rar_opt} /data/pictures/index/rar/$3.rar ${files}

and I get the same problem. The files are definitely there and also the directories are ok. I'm close to give up ;-((
 
Old 05-18-2003, 03:42 PM   #20
steltner
LQ Newbie
 
Registered: May 2003
Posts: 18

Original Poster
Rep: Reputation: 0
Hallo unSpawn,

I got a solution, script 1 (compress.sh):

#! /bin/sh
files=$(find /data/pictures/index/bmp/$1 -type f -name $1.$2*.bmp)
/opt/rar/rar m -s -rr8 -cl -hp$3 -m5 /data/pictures/index/rar/$1/$1.$2.01.rar ${files}

script 2 (c.sh):

sh -x compress.sh 1999 103 $1
sh -x compress.sh 1999 104 $1

I found out that all the time when I tried to call RAR with a wildcard *.BMP than I got the error. When I use your suggestion regarding the files-variable than it's working.

Puhhh, it took log, but right now I'm happy!

I thank you very much!

Joern
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM
A problem about a shell script jpan Linux - General 2 01-19-2005 07:14 PM
Problem in shell script Kumar Programming 4 04-27-2004 09:48 AM
Shell-Script Problem? x4v013 Slackware 7 09-17-2003 01:15 AM
shell script problem steltner Programming 0 05-17-2003 04:26 PM

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

All times are GMT -5. The time now is 02:03 AM.

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