I’m supposed to save a bunch of the GNOME directories when upgrading from FC5 to FC7. I didn’t feel like typing each directory name manually so I came up with a simple script to do it for me. Now all I have to do is just save this script on the user’s desktop, run it and let it do my bidding!#!/bin/sh
# Define system binaries for sake of doing this properly
MV=/bin/mv
MKDIR=/bin/mkdir
LDIR=/var/tmp/
# Define the date to be used later on in the script
DATE=”`date +%y%m%d`”
# Specify the directory list so we don’t have to specify them in here to keep
# the script clean You can edit this file and add more directories as needed
FILE=”dir.list”
# Let’s loop through the directory.list and get the folder names that we need to
# preserve
DIRECTORY=”"
while [ 1 ]
do
read DIRECTORY || break
echo “$DIRECTORY”
# Create the preserve directory to move the files and folders into
$MKDIR $LDIR/.dot.preserved.$DATE
# Move everything now but be verbose about it so we know what’s going on
$MV -v $DIRECTORY $LDIR/.dot.preserved.$DATE
# Done reading dir.list
done < $FILE
# Exit the script now
exit
That’s pretty much it. If you see anything wrong with the script, please let me know.