Name that OS? Linux blackbird 2.6.8-24.16-default #1 Thu Jun 2 12:09:57 UTC 2005 i686 i686 i386 GNU/Linux Hint: There is no open in it. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
2009/10/10 David C. Rankin
Name that OS?
Linux blackbird 2.6.8-24.16-default #1 Thu Jun 2 12:09:57 UTC 2005 i686 i686 i386 GNU/Linux
Hint: There is no open in it.
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com --
SuSE (yes, only "u" in lower case) version 9.2... What did I win? :P -- Ciro Iriarte http://cyruspy.wordpress.com -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
2009/10/10 Ciro Iriarte
2009/10/10 David C. Rankin
: Name that OS?
Linux blackbird 2.6.8-24.16-default #1 Thu Jun 2 12:09:57 UTC 2005 i686 i686 i386 GNU/Linux
Hint: There is no open in it.
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com --
SuSE (yes, only "u" in lower case) version 9.2...
What did I win? :P
My turn... Linux cerberos 2.4.19-4GB #1 Fri Sep 13 13:19:15 UTC 2002 i686 unknown -- Ciro Iriarte http://cyruspy.wordpress.com -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ciro Iriarte wrote:
2009/10/10 Ciro Iriarte
: 2009/10/10 David C. Rankin
: Name that OS?
Linux blackbird 2.6.8-24.16-default #1 Thu Jun 2 12:09:57 UTC 2005 i686 i686 i386 GNU/Linux
Hint: There is no open in it.
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- SuSE (yes, only "u" in lower case) version 9.2...
What did I win? :P
My turn...
Linux cerberos 2.4.19-4GB #1 Fri Sep 13 13:19:15 UTC 2002 i686 unknown ^^^^^^^^^^
Friday 13th!?... guard dog of the underworld... hmmm... :-)
- -- ============================================================================== I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone. Bjarne Stroustrup ============================================================================== -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkrRqRgACgkQasN0sSnLmgI/VACdFJQJVuUi3LiCEuGImWlxBzv8 iBQAn1XYzcWPOpAsOB04B37B7bNuVm0K =M/Ok -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 10/11/2009 05:44 AM, G T Smith wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ciro Iriarte wrote:
2009/10/10 Ciro Iriarte
: 2009/10/10 David C. Rankin
: Name that OS?
Linux blackbird 2.6.8-24.16-default #1 Thu Jun 2 12:09:57 UTC 2005 i686 i686 i386 GNU/Linux
Hint: There is no open in it.
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- SuSE (yes, only "u" in lower case) version 9.2...
What did I win? :P
My turn...
Linux cerberos 2.4.19-4GB #1 Fri Sep 13 13:19:15 UTC 2002 i686 unknown
Wow. That's an oldie! I'm gonna guess SuSE Linux 8.1? I tried to cheat but this goes back before we started using CVS and hell, even I've thrown that media out. ;) -Jeff -- Jeff Mahoney SuSE Labs -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Jeff Mahoney pecked at the keyboard and wrote:
On 10/11/2009 05:44 AM, G T Smith wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ciro Iriarte wrote:
2009/10/10 Ciro Iriarte
: 2009/10/10 David C. Rankin
: My turn...
Linux cerberos 2.4.19-4GB #1 Fri Sep 13 13:19:15 UTC 2002 i686 unknown
Wow. That's an oldie! I'm gonna guess SuSE Linux 8.1? I tried to cheat but this goes back before we started using CVS and hell, even I've thrown that media out. ;)
-Jeff
The oldest version I still have is a box set from 6.1. Don't know what happened to the 5.x set. -- Ken Schneider SuSe since Version 5.2, June 1998 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
2009/10/11 Jeff Mahoney
On 10/11/2009 05:44 AM, G T Smith wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ciro Iriarte wrote:
2009/10/10 Ciro Iriarte
: 2009/10/10 David C. Rankin
: Name that OS?
Linux blackbird 2.6.8-24.16-default #1 Thu Jun 2 12:09:57 UTC 2005 i686 i686 i386 GNU/Linux
Hint: There is no open in it.
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- SuSE (yes, only "u" in lower case) version 9.2...
What did I win? :P
My turn...
Linux cerberos 2.4.19-4GB #1 Fri Sep 13 13:19:15 UTC 2002 i686 unknown
Wow. That's an oldie! I'm gonna guess SuSE Linux 8.1? I tried to cheat but this goes back before we started using CVS and hell, even I've thrown that media out. ;)
-Jeff
-- Jeff Mahoney SuSE Labs --
Yup, you're right... It was a powerful firewall running on a 486 (or was 586?) with 8MB of RAM (2x4MB).... Actually decommissioned... Regards, -- Ciro Iriarte http://cyruspy.wordpress.com -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 11 Oct 2009, Jeff Mahoney wrote:
On 10/11/2009 05:44 AM, G T Smith wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ciro Iriarte wrote:
2009/10/10 Ciro Iriarte
: [...] My turn...
Linux cerberos 2.4.19-4GB #1 Fri Sep 13 13:19:15 UTC 2002 i686 unknown
Wow. That's an oldie! I'm gonna guess SuSE Linux 8.1? I tried to cheat but this goes back before we started using CVS and hell, even I've thrown that media out. ;)
Cheating would have given you this: # rpm2cpio SuSE-8.1-DVD-i386-Int-RC5/suse/i586/k_athlon-2.4.19-66.i586.rpm | cpio -i --to-stdout boot/vmlinuz | strings | grep 2.4.19 2.4.19-4GB (root@Athlon.suse.de) #1 Fri Sep 13 13:19:15 UTC 2002 Steffen -- Das Nichtrauchen entfernt uns von der Zivilisation und setzt den Mann mit seinem Dackel gleich. -- J. C. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 10 October 2009 10:59:12 pm Ciro Iriarte wrote:
2009/10/10 Ciro Iriarte
: 2009/10/10 David C. Rankin
: Name that OS?
Linux blackbird 2.6.8-24.16-default #1 Thu Jun 2 12:09:57 UTC 2005 i686 i686 i386 GNU/Linux
Hint: There is no open in it.
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com --
SuSE (yes, only "u" in lower case) version 9.2...
What did I win? :P
My turn...
Linux cerberos 2.4.19-4GB #1 Fri Sep 13 13:19:15 UTC 2002 i686 unknown
SuSE 8.1? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 10 October 2009 10:46:06 pm Ciro Iriarte wrote:
2009/10/10 David C. Rankin
: Name that OS?
Linux blackbird 2.6.8-24.16-default #1 Thu Jun 2 12:09:57 UTC 2005 i686 i686 i386 GNU/Linux
Hint: There is no open in it.
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com --
SuSE (yes, only "u" in lower case) version 9.2...
What did I win? :P
You Drilled it!, That's got to be worth a couple of beers or something :p 00:42 blackbird:~> cat /etc/SuSE-release SuSE Linux 9.2 (i586) VERSION = 9.2 It's like this thing has been in a time capsule. 00:42 blackbird:~> df -h Filesystem Size Used Avail Use% Mounted on /dev/hda2 57G 2.6G 54G 5% / tmpfs 189M 12K 189M 1% /dev/shm -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 10/11/2009 09:03 AM, David C. Rankin wrote:
00:42 blackbird:~> cat /etc/SuSE-release SuSE Linux 9.2 (i586) VERSION = 9.2
It's like this thing has been in a time capsule.
00:42 blackbird:~> df -h Filesystem Size Used Avail Use% Mounted on /dev/hda2 57G 2.6G 54G 5% / tmpfs 189M 12K 189M 1% /dev/shm
Cool, beat you! $ uname -a Linux doc 2.4.21-303-smp4G #1 SMP Tue Dec 6 12:33:10 UTC 2005 i686 i686 i386 GNU/Linux $ cat /etc/SuSE-release SuSE Linux 9.0 (i586) VERSION = 9.0 $ df -h Filesystem Size Used Avail Use% Mounted on /dev/hda4 4.8G 2.1G 2.8G 43% / /dev/hda3 1.1G 757M 271M 74% /var /dev/hdb1 4.1G 1.2G 2.9G 30% /usr /dev/hdb2 2.0G 207M 1.8G 11% /opt tmpfs 62M 0 62M 0% /dev/shm $ free total used free shared buffers cached Mem: 125596 123016 2580 0 9156 20276 -/+ buffers/cache: 93584 32012 Swap: 265064 5592 259472 $ rpm -qa --last | tail -n1 gpg-pubkey-3d25d3d9-36e12d04 Sat 13 Dec 2003 09:54:57 GMT Still going strong. --Chris R. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Mon, 12 Oct 2009, Chris Ross wrote:
On 10/11/2009 09:03 AM, David C. Rankin wrote: [..] Cool, beat you!
$ uname -a Linux doc 2.4.21-303-smp4G #1 SMP Tue Dec 6 12:33:10 UTC 2005 i686 i686 i386 GNU/Linux
$ cat /etc/SuSE-release SuSE Linux 9.0 (i586) VERSION = 9.0
$ rpm -q --queryformat \ '%{name}-%{version}-%{release}\t%{installtime:date}\ \t\t\t%{buildtime:date}\n' lx_suse lx_suse-2.2.10.SuSE-2 Wed 25 Aug 1999 04:00:31 AM CEST Thu 22 Jul 1999 04:11:42 PM CEST $ uname -a Linux slarty 2.4.37.5 #2 Sun Aug 16 11:47:51 CEST 2009 i686 unknown $ dfall -h | headntail -s 1 -e 2:1 Size Used Avail Use% Mounted GB: 1024 837 169 81.7% (and I'm currently moving data from a 160G disc, to replace it with an 500G disc, and I moved quite a bit to the other box (see below)) $ grep ^Mem: /proc/meminfo Mem: 328421376 324075520 4345856 0 24006656 179707904
$ rpm -qa --last | tail -n1 gpg-pubkey-3d25d3d9-36e12d04 Sat 13 Dec 2003 09:54:57 GMT
$ rpm -qa --last | tail -n1 bc-1.04-74 Mon 16 Aug 1999 07:19:26 I suppose we can close this thread now ...
Still going strong.
Same here. It's my main box, despite a new 2x2GHz box (with a lot more storage) beside it ;) -dnh -- To resist the influence of others, knowledge of one's self is most important. -- Teal'C, Stargate SG-1, 9x14 - Stronghold -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2009-10-12 at 14:54 +0100, Chris Ross wrote:
Cool, beat you!
$ uname -a Linux doc 2.4.21-303-smp4G #1 SMP Tue Dec 6 12:33:10 UTC 2005 i686 i686 i386 GNU/Linux
$ cat /etc/SuSE-release SuSE Linux 9.0 (i586) VERSION = 9.0
I have a 5.2 on a 386SX20 (5MiB) nearby, but it has no network: I got a second hand card for it, but I haven't been able to make it work. I might connect to it via serial port and ppp, if I'm sufficiently bored and inspired some day :-) I also have a 7.3 in working order. Nice distros. A shame that SuSE removed the archive in order to save a few bytes of storage. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkrTfLkACgkQtTMYHG2NR9W8LwCeIkZ7yBmIg6R8dr0k3ogO/Qgs FV4An1zfAc6mnJMRa3LZkNUKWtOaKUoj =1yQY -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hey all, I'm looking for a bash script that can do the following. My employer does nightly backups of our clients data that are rarred for compression reasons (a 5GB db compresses down to ~400 meg). What we would like to do is recursively search through the backup folder and unrar the data as when they call in on a issue we load their data to see what is going on. The FTP has directory structure like this: /backup/client1/010109/ /backup/client1/010309/ /backup/client1/010509/ /backup/client2/010109/ /backup/client2/010309/ /backup/client2/010509/ In each of the *day folders there are split rar files and the first rar file is always .rar What we want to do is to run a script that will unrar those files on Tuesday, Thursday and Saturday. The cron part I know how to do. We would like the extracted data to fall into the clients root directory example and then delete the Monday/Wed/Friday folders: /backup/client1/010109.db /backup/client1/010309.db /backup/client1/010509.db /backup/client2/010109.db /backup/client2/010309.db /backup/client2/010509.db Now there are roughly 500 clients that have this backup done so one magical script that would do it for all the clients directories in the /backup directory would be great. I should also note that the subfolders in /backup are not always called client1, client2, etc etc but are the names of the clients themselves. Any help would be appreciated Dean -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 12 October 2009 21:42:39 Dean Hilkewich wrote:
What we want to do is to run a script that will unrar those files on Tuesday, Thursday and Saturday. The cron part I know how to do. We would like the extracted data to fall into the clients root directory example and then delete the Monday/Wed/Friday folders:
/backup/client1/010109.db /backup/client1/010309.db /backup/client1/010509.db /backup/client2/010109.db /backup/client2/010309.db /backup/client2/010509.db
You mean something like for clientdir in /backup/*; do cd $clientdir for daydir in $clientdir/*; do unrar $daydir/*.rar rm -rf $daydir done done perhaps? Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anders Johansson wrote:
On Monday 12 October 2009 21:42:39 Dean Hilkewich wrote:
What we want to do is to run a script that will unrar those files on Tuesday, Thursday and Saturday. The cron part I know how to do. We would like the extracted data to fall into the clients root directory example and then delete the Monday/Wed/Friday folders:
/backup/client1/010109.db /backup/client1/010309.db /backup/client1/010509.db /backup/client2/010109.db /backup/client2/010309.db /backup/client2/010509.db
You mean something like
for clientdir in /backup/*; do cd $clientdir for daydir in $clientdir/*; do unrar $daydir/*.rar rm -rf $daydir done done
perhaps?
Anders
Ya something like that. Anyway of making check to see if the unrar was found and successfully extracted before deleting the daydirs? Also I notice that some of the older clients that are using the DOS based version have their rar's first file as .r01 instead of .rar (older rar version would be the reason for the extension difference I would guess). Thanks for the help btw. Dean -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 12 October 2009 22:00:51 Dean Hilkewich wrote:
Ya something like that. Anyway of making check to see if the unrar was found and successfully extracted before deleting the daydirs? Also I notice that some of the older clients that are using the DOS based version have their rar's first file as .r01 instead of .rar (older rar version would be the reason for the extension difference I would guess). Thanks for the help btw.
Hm, ok, something like this then for clientdir in /backup/*; do cd $clientdir for daydir in $clientdir/*; do rarfile=$daydir/*.rar if [ ! -e $rarfile ]; then rarfile=$daydir/*.r01 fi unrar x $rarfile [ $? -eq 0 ] && rm -rf $daydir done done Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anders Johansson wrote:
On Monday 12 October 2009 22:00:51 Dean Hilkewich wrote:
Ya something like that. Anyway of making check to see if the unrar was found and successfully extracted before deleting the daydirs? Also I notice that some of the older clients that are using the DOS based version have their rar's first file as .r01 instead of .rar (older rar version would be the reason for the extension difference I would guess). Thanks for the help btw.
Hm, ok, something like this then
for clientdir in /backup/*; do cd $clientdir for daydir in $clientdir/*; do rarfile=$daydir/*.rar if [ ! -e $rarfile ]; then rarfile=$daydir/*.r01 fi unrar x $rarfile [ $? -eq 0 ] && rm -rf $daydir done done
Anders
Thanks, that works. Dean -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Mon, 12 Oct 2009, Dean Hilkewich wrote:
Anders Johansson wrote:
Hm, ok, something like this then
for clientdir in /backup/*; do cd $clientdir for daydir in $clientdir/*; do rarfile=$daydir/*.rar if [ ! -e $rarfile ]; then rarfile=$daydir/*.r01 fi
if ! test -e $rarfile; then echo "cannot find rarfile in $clientdir" >&2 continue; ### or exit? Depends what you want fi
unrar x $rarfile [ $? -eq 0 ] && rm -rf $daydir
Why the 'test'? And 'x' is the wrong command (fullpath, you want current dir, it might make no difference here though, that depends on how the rar was packed). And 'rar' is more robust, so one should prefer that over 'unrar' if rar is installed (which I assume). rar e "$rarfile" && rm -rf "$daydir" I'm not that sure on what conditions rar exits with a status != 0, so one might want to test / read up on that before really running that 'rm -rf'. That affects both variants.
done done
HTH, -dnh -- Who stole my tagline? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David Haller wrote:
Hello,
On Mon, 12 Oct 2009, Dean Hilkewich wrote:
Anders Johansson wrote:
Hm, ok, something like this then
for clientdir in /backup/*; do cd $clientdir for daydir in $clientdir/*; do rarfile=$daydir/*.rar if [ ! -e $rarfile ]; then rarfile=$daydir/*.r01 fi
if ! test -e $rarfile; then echo "cannot find rarfile in $clientdir" >&2 continue; ### or exit? Depends what you want fi
unrar x $rarfile [ $? -eq 0 ] && rm -rf $daydir
Why the 'test'? And 'x' is the wrong command (fullpath, you want current dir, it might make no difference here though, that depends on how the rar was packed). And 'rar' is more robust, so one should prefer that over 'unrar' if rar is installed (which I assume).
rar e "$rarfile" && rm -rf "$daydir"
I'm not that sure on what conditions rar exits with a status != 0, so one might want to test / read up on that before really running that 'rm -rf'. That affects both variants.
done done
HTH, -dnh
So what would the script look like if you were to put it though David? If it exits other then 0 would it be possible to log the failure and continue on to the next leaving the failed extractions source directory untouched? This is what I found on the exit codes for rar: RAR exits with a zero code (0) in case of successful operation. The exit code of non-zero means the operation is cancelled due to error: 255 USER BREAK User stopped the process 9 CREATE ERROR Create file error 8 MEMORY ERROR Not enough memory for operation 7 USER ERROR Command line option error 6 OPEN ERROR Open file error 5 WRITE ERROR Write to disk error 4 LOCKED ARCHIVE Attempt to modify an archive previously locked by the 'k' command 3 CRC ERROR A CRC error occurred when unpacking 2 FATAL ERROR A fatal error occurred 1 WARNING Non fatal error(s) occurred 0 SUCCESS Successful operation (User exit) Thanks for your guys help once again Dean -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Mon, 12 Oct 2009, Dean Hilkewich wrote:
David Haller wrote:
On Mon, 12 Oct 2009, Dean Hilkewich wrote:
Anders Johansson wrote:
Hm, ok, something like this then
for clientdir in /backup/*; do cd $clientdir for daydir in $clientdir/*; do rarfile=$daydir/*.rar if [ ! -e $rarfile ]; then rarfile=$daydir/*.r01 fi
if ! test -e $rarfile; then echo "cannot find rarfile in $clientdir" >&2 continue; ### or exit? Depends what you want fi
unrar x $rarfile [ $? -eq 0 ] && rm -rf $daydir
Why the 'test'? And 'x' is the wrong command (fullpath, you want current dir, it might make no difference here though, that depends on how the rar was packed). And 'rar' is more robust, so one should prefer that over 'unrar' if rar is installed (which I assume).
rar e "$rarfile" && rm -rf "$daydir"
I'm not that sure on what conditions rar exits with a status != 0, so one might want to test / read up on that before really running that 'rm -rf'. That affects both variants.
done done
So what would the script look like if you were to put it though David?
Something like this: ==== This script was brought to you by a very tired 'dnh', to the sound of "The Allman Brothers Band" playing "Whipping Post" and more than a couple of good german beers and should be very closely scrutinized before use! I AM NOT RESPONSIBLE FOR ANYTHING! ==== #!/bin/bash BASEDIR="/backup" verbose=1 ### log to which file? Or use tee and/or logger ... Lots of nifty ### things possible ;) Default (no exec "rewiring"): log to ### STDERR i.e. /dev/stderr # exec 2>/var/log/backup_extraction_logfile pushd "$BASEDIR" || exit 3 ### ensuring a) we can change there, and b) ### gets us a defined stack for the popd in ### following the loop for clientdir in "${BASEDIR}"/*; do popd ### Untested, should work, because the "continue 2" ... pushd "$clientdir" || { echo "Cannot pushd to '$clientdir'" >&2; exit 1; ### one could try to 'continue' instead } for daydir in "$clientdir"/*; do for exts in rar r00 r01; do ### I think I remember seeing .r00 as the first part of ### a split rar-Archive, at least more than .r01. This ### way, we should cover it, going by likelyhood of ### extensions. rarfile="$daydir"/*.${ext} ### the archive should not only exist (-e) but also be readable (-r)! if test -r "$rarfile"; then # ### Simple case: skip deletion on extraction failure: # rar e "$rarfile" && rm -rf "$daydir" # ### Alternatively something like this: rar e "$rarfile" ### Handle rar return-codes as wanted/needed: case $? in ### USER BREAK 255) exit 2;; #### 9 CREATE ERROR Create file error 9) echo "CREATE ERROR" >&2; continue 2;; ### MEMORY ERROR Not enough memory for operation 8) echo "ENOMEM" >&2; continue 2;; ### 7 USER ERROR Command line option error ### should not happen in this script 7) echo "Internal script-error: Invalid option to rar" >&2; continue 2 ;; ### 6 OPEN ERROR Open file error 6) echo "Could not open file" >&2; continue 2;; ### 5 WRITE ERROR Write to disk error 5) echo "Could not write file" >&2; continue 2;; ### 4 LOCKED ARCHIVE Attempt to modify ### an archive previously locked by the 'k' ### command ### 3 CRC ERROR A CRC error occurred ### when unpacking 3) echo "rar CRC ERROR" >&2; continue 2;; ### 2 FATAL ERROR A fatal error occurred 2) echo "rar FATAL ERROR" >&2; exit 1; ### 1 WARNING Non fatal error(s) occurred # 1) echo "warning ignored" >&2;; ### 0 == Success 0) if test $verbose -gt 0; then echo "Successfully extracted '$rarfile', removing '$daydir'" >&2; rm -rf "$daydir" fi continue 2 ;; ### default (should not happen), so abort if it does *) echo "Unknown 'rar' return code: $?" >&2; exit 2;; esac fi done ### no .rar, r00 nor .r01 found ... Emit message and continue ... echo "cannot find a rarfile in '$clientdir'" >&2 continue; ### continue next loop "out", i.e. skip this ### dir. Exit script instead?? That'll depend ### on what you want done done ==== I hope I've got it right. Basic "sanity checking" should suffice though ;)
If it exits other then 0 would it be possible to log the failure and continue on to the next leaving the failed extractions source directory untouched?
Sure. BTW: I think you really DO want to change your dir- and archivenames to the ISO format of YYYYMMDD (e.g. 20091013) in the long run ... HTH, -dnh, very tired and definitely not sober anymore ;) -- Such an archaic device, the letter -- but personal in a way no recording could achieve. -- from "Dune Messiah" by Frank Herbert -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tuesday 13 October 2009 00:00:44 David Haller wrote:
if ! test -e $rarfile; then echo "cannot find rarfile in $clientdir" >&2 continue; ### or exit? Depends what you want fi
Yes David, and if you read the email I was responding to, it said what he wanted, which was to use r01 instead of rar in case .rar didn't exist
Why the 'test'?
readability
And 'x' is the wrong command (fullpath, you want current dir, it might make no difference here though, that depends on how the rar was packed).
good point
I'm not that sure on what conditions rar exits with a status != 0
on errors. It exits with 0 when everything went OK Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tuesday 13 October 2009 00:00:44 David Haller wrote:
And 'rar' is more robust, so one should prefer that over 'unrar' if rar is installed (which I assume).
rar is not included in the distribution. It is only available through packman, and it looks like it is closed source, and you're only allowed to use it for 40 days without acquiring a license. I don't think you should be recommending it Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Tue, 13 Oct 2009, Anders Johansson wrote:
On Tuesday 13 October 2009 00:00:44 David Haller wrote:
And 'rar' is more robust, so one should prefer that over 'unrar' if rar is installed (which I assume).
rar is not included in the distribution. It is only available through packman, and it looks like it is closed source, and you're only allowed to use it for 40 days without acquiring a license. I don't think you should be recommending it
I am (ATM) not sure where I got my RAR 3.00 beta 3 Copyright (c) 1993-2002 Eugene Roshal 21 Feb 2002 Shareware version Type RAR -? for help from, don't want to boot the new box to look what I got there (something newer) for this, I'll look tomorrow, but it _is_ more robust (e.g. with password-protected files, IIRC) than 'unrar'. I was just saying that _IFF_ you use that rar anyway, it might save you some grief to use it for extraction as well. RAR has a wierd licensing, anyway, IIRC. [..]
if ! test -e $rarfile; then echo "cannot find rarfile in $clientdir" >&2 continue; ### or exit? Depends what you want fi
Yes David, and if you read the email I was responding to,
Of COURSE I have! I always do.
it said what he wanted, which was to use r01 instead of rar in case .rar didn't exist
What about neither .rar nor .r01 existing? But e.g. an .r00 or none at all??? How do you handle that? That's what my block o' code does. Find a more elaborate version in my other mail.
Why the 'test'? readability
Oh, that was just about the or command command test $? -eq 0 && command2 [ $? -eq 0 ] && command2 versus the "simpler" command && command2 or if command; then command2; fi which is _exactly_ the same in effect ... Just one of my pet-peeves[0] ;) If one of the above is better readable than the 'c1 && c2', you should (generally speaking from experience) be using a nicely formatted 'if command; then .. fi' anyway. It is quite uncommon to need to check for specific exit-codes other that 0 or !0. Rule of thumb: Any use of $? except in case $? in ... esac OR retval=$? do_something_with $retval do_more_with_retval [..] is (usually) quite superfluous. -dnh [0] got quite a collection of those :) -- Ah, the beauty of OSS. Hundreds of volunteers worldwide volunteering their time inventing and implementing new, exciting ways for software to suck. -- Toni Lassila -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hm, ok, something like this then
for clientdir in /backup/*; do cd $clientdir for daydir in $clientdir/*; do rarfile=$daydir/*.rar if [ ! -e $rarfile ]; then rarfile=$daydir/*.r01 fi unrar x $rarfile [ $? -eq 0 ] && rm -rf $daydir done done
Anders
Thanks, that works.
if there is more than one rar file in $daydir, then you are going to run into problems - rarfile will be a space separated list of all the files, and the if will fail because of too many arguments. Also, assuming there is no rar file, then $rarfile will be $daydir/*.rar (literal), so the test for its existance will fail, and rarfile will become either a) the name of the only .r01 file if there is only one b) space separated list of all the .r01 files (if there are more than one) c) $daydir/*.r01 (literal) if there are none. You probably want something more like this: for clientdir in /backup/*; do cd "${clientdir}" for daydir in "${clientdir}"/*; do for rarfile in "${daydir}"/*.{rar,r01}; do unrar x "${rarfile}" && rm -rf "${daydir}" done done done This assumes that where you have .rar files and .r01 files, you want to unrar them both. If you want something else, then you'll need something different to check for both a .rar and a .r01 file. Personally, I'd break out sed, but then the unnecessary-invocations-of-external-command police would scold me for not using the shell equivalent... for clientdir in /backup/*; do cd "${clientdir}" for daydir in "${clientdir}"/*; do for rarfile in "${daydir}"/*.{rar,r01}; do rarname=`echo "${rarfile}" | sed -re 's/(.*)\.rar/\1/'` [ ! -e "${rarname}".r01 ] && unrar x "${rarfile}" && rm -rf "${daydir}" done done done That will not unrar a rar file if a r01 file exists with the same first part of the name. but it is guilty of that unnecessary invocation of sed. something like rarname="${rarfile/.rar/}".r01 might suit. BASH gurus will confirm or shoot me down.. Phil -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tuesday 13 October 2009 00:27:10 Philip Dowie wrote:
That will not unrar a rar file if a r01 file exists with the same first part of the name. but it is guilty of that unnecessary invocation of sed. something like
rarname="${rarfile/.rar/}".r01
might suit. BASH gurus will confirm or shoot me down..
This was exactly what I was testing for in my script. If a rar file exists, use it, otherwise go with the r01 - without sed Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Philip Dowie wrote:
if there is more than one rar file in $daydir, then you are going to run into problems - rarfile will be a space separated list of all the files, and the if will fail because of too many arguments.
Also, assuming there is no rar file, then $rarfile will be $daydir/*.rar (literal), so the test for its existance will fail, and rarfile will become either a) the name of the only .r01 file if there is only one b) space separated list of all the .r01 files (if there are more than one) c) $daydir/*.r01 (literal) if there are none.
You probably want something more like this:
for clientdir in /backup/*; do cd "${clientdir}" for daydir in "${clientdir}"/*; do for rarfile in "${daydir}"/*.{rar,r01}; do unrar x "${rarfile}" && rm -rf "${daydir}" done done done
This assumes that where you have .rar files and .r01 files, you want to unrar them both. If you want something else, then you'll need something different to check for both a .rar and a .r01 file.
Personally, I'd break out sed, but then the unnecessary-invocations-of-external-command police would scold me for not using the shell equivalent...
for clientdir in /backup/*; do cd "${clientdir}" for daydir in "${clientdir}"/*; do for rarfile in "${daydir}"/*.{rar,r01}; do rarname=`echo "${rarfile}" | sed -re 's/(.*)\.rar/\1/'` [ ! -e "${rarname}".r01 ] && unrar x "${rarfile}" && rm -rf "${daydir}" done done done
That will not unrar a rar file if a r01 file exists with the same first part of the name. but it is guilty of that unnecessary invocation of sed. something like
rarname="${rarfile/.rar/}".r01
might suit. BASH gurus will confirm or shoot me down..
Phil
Hi Phil, The files are multi-file spanned. Extracting the .rar file should extract all the rest of the .rxx files as they are in the chain listed in the first rar file. In some cases the starting rar is not a .rar but a .r01. Upon further reading the other way spanned rars can appear depending on the version of rar is that they may be named such as this as well: Filename.000.rar Filename.001.rar Filename.002.rar etc. -or- Filename.part01.rar Filename.part02.rar Filename.part03.rar Dean -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tuesday 13 October 2009 00:37:55 Dean Hilkewich wrote:
Filename.000.rar Filename.001.rar Filename.002.rar etc.
-or-
Filename.part01.rar Filename.part02.rar Filename.part03.rar
Can there be more than one rar-sequence in a directory? Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anders Johansson wrote:
On Tuesday 13 October 2009 00:37:55 Dean Hilkewich wrote:
Filename.000.rar Filename.001.rar Filename.002.rar etc.
-or-
Filename.part01.rar Filename.part02.rar Filename.part03.rar
Can there be more than one rar-sequence in a directory?
Anders
In my case no there shouldn't be more then one rar sequence in a directory and that's why deleting the directory after a successful extraction should work here. I'm just saying that there could be multiple naming schemes on how a spanned set is named. From what I've seen so far is a set can start with .rar (most common) or .r01 (less common) and really old versions of rar and some 3rd party compression utils that create rars as well can have the above listed sequence. In all cases though to extract the complete spanned volume the extraction command only has to be ran on the first in the sequence. Dean -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anders Johansson wrote:
for clientdir in /backup/*; do cd $clientdir for daydir in $clientdir/*; do rarfile=$daydir/*.rar if [ ! -e $rarfile ]; then rarfile=$daydir/*.r01 fi unrar x $rarfile [ $? -eq 0 ] && rm -rf $daydir done done
Anders
OK this worked great except I ran into one snag. It seems that some of the older customers who are running a different version of our software and upload the ftp only upload once a week. Where this is a issue is that unlike the others that have a separate days of the week folders their rar set gets upped just into their /backup/clientdir/ so you end up with a situation where their directory looks like this with still only one rar set in their client folder: /backup/clientdir/backup.rar /backup/clientdir/backup.r01 /backup/clientdir/backup.r02 etc How can we modify the script so that it also checks to see if there is a rar set in the clients directory instead of a subfolder? Ideally it would just unrar that file in the client directory and just delete the *.r* files after successful extraction instead of deleting the folder. Again your help is very much appreciated. Dean -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tuesday 13 October 2009 02:02:18 Dean Hilkewich wrote:
How can we modify the script so that it also checks to see if there is a rar set in the clients directory instead of a subfolder? Ideally it would just unrar that file in the client directory and just delete the *.r* files after successful extraction instead of deleting the folder.
It sounds like the script could develop into a quite complicated set of tests - wouldn't it be better to enforce a standard? It sounds as though it would make everything a lot easier Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2009/10/10 23:21 (GMT-0400) David C. Rankin composed:
Name that OS?
Why?
Linux blackbird 2.6.8-24.16-default #1 Thu Jun 2 12:09:57 UTC 2005 i686 i686 i386 GNU/Linux
Hint: There is no open in it.
Mandriva 10.1 and SuSE 9.2 both used 2.6.8 and were released late 2004. The -24 makes me think not Mandriva, likely 9.2 or something else entirely. Google says 9.2 did use 2.6.8-24.16. SuSE 9.2, final answer. -- " A patriot without religion . . . is as great a paradox, as an honest man without the fear of God. . . . 2nd U.S. President, John Adams Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 10 October 2009 11:21:55 pm Felix Miata wrote:
On 2009/10/10 23:21 (GMT-0400) David C. Rankin composed:
Name that OS?
Why?
It was Saturday -- just for the heck of it ;-)
Linux blackbird 2.6.8-24.16-default #1 Thu Jun 2 12:09:57 UTC 2005 i686 i686 i386 GNU/Linux
Hint: There is no open in it.
Mandriva 10.1 and SuSE 9.2 both used 2.6.8 and were released late 2004. The -24 makes me think not Mandriva, likely 9.2 or something else entirely. Google says 9.2 did use 2.6.8-24.16. SuSE 9.2, final answer.
You are tied with Ciro :p -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (13)
-
Anders Johansson
-
Carlos E. R.
-
Chris Ross
-
Ciro Iriarte
-
David C. Rankin
-
David Haller
-
Dean Hilkewich
-
Felix Miata
-
G T Smith
-
Jeff Mahoney
-
Ken Schneider - openSUSE
-
Philip Dowie
-
Steffen Winterfeldt