January 31st, 2002, 04:46 AM
Shell Script to List Directories...
I am new to shell scripting. I am running Red Hat using Bash. I am trying to create a little script that will loop through the -sub-directories of the systems home directory, and then recursively zip up the contents of each one saving it as the name of that particularly directory.
I cannot figure out how to do this. Can anyone help?
February 4th, 2002, 10:40 PM
# cd to the directory you want to backup first.
# You could also easily modify the script to take
#command line arguments.
for user in $( ls . )
tar czvf /back_up_dir/$user.tar.gz $user