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