Mailinglist Archive: opensuse (1599 mails)

< Previous Next >
Re: [opensuse] Bash Guru help needed, recursively extract rarred files
  • From: Anders Johansson <ajohansson@xxxxxxx>
  • Date: Mon, 12 Oct 2009 21:53:52 +0200
  • Message-id: <200910122153.53000.ajohansson@xxxxxxx>
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@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups