Hiya,
I've been plugging away at this script and I cant get it to behave as I need.
first off it fails to adhere to the conditions of the file limit, and zips the directory regardless of the file count and secondly, but less important it zips up the entire path not just the directory I'm after.
Been at this for hours and I could use a hand.
tired in glasgow
#!/bin/bash
location_Parent=/path/Parent
location_IMG=/path/IMG
location_AUD=/path/AUD
time_a=20090614-205534
echo zipping and deleting dupes
IMG_CNT_MAX=1000
cd $location_IMG
FILECOUNT=$(ls | wc -l)
if [ $FILECOUNT < $IMG_CNT_MAX ]
then
echo "zipping and deleeting dupes";
cd $location_Parent
tar -zcvf $time_a-IMG.tar.gz $location_IMG
tar -zcvf $time_a-AUD.tar.gz $location_AUD
wait
rm -r $location_IMG
rm -r $location_AUD
else
echo "Number of files has not yet reached $IMG_CNT_MAX, not ready to archive";
fi