I am creating a Loop that will let me rsync files from a variable directory one level above and then bzip those files at every level, infinitely until I press CTRL+C. So far this is what I have for the shell script:
while :
do
rsync -av ../gene/ .
bzip2 -kv */*/*/*/*/*/*/*
bzip2 -kv */*/*/*/*/*/*
bzip2 -kv */*/*/*/*/*
bzip2 -kv */*/*/*/*
bzip2 -kv */*/*/*
bzip2 -kv */*/*
bzip2 -kv */*
echo "Press [CTRL+C] to stop.."
sleep 1
done
What I would like to have happen is it ask for the directory that it should rsync from. The directory is not always gene and is variable, so user input is a must. Any help with this and possibly cleaning the script up is much appreciated.