This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Script to save XP Win stuff
- From: jwzumwalt <jwzumwalt at neatinfo dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 19 Dec 2010 11:33:28 -0800 (PST)
- Subject: Script to save XP Win stuff
I thought I would share a script I use to save my important personal and
config files.
I hope this helps!
#!/bin/bash
# Pretty ANSI writing
OFF="\033[0m"
BOLD="\033[1m"
DIM="\033[2m"
RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
BLUE="\033[1;34m"
dir_name="personal_backup_`date +%Y-%m-%d_%H.%M.%S`"
mkdir /cygdrive/f/$dir_name
mkdir /cygdrive/f/$dir_name/cygwin
START_TIME=`date +%s`
# start time
echo -en "\n\t Start time:\t $GREEN`date +%Y-%m-%d_%H.%M.%S`$OFF\n"
# screen
echo "Start time: `date +%Y-%m-%d_%H.%M.%S`" >
/cygdrive/f/$dir_name/logfile.txt # log file
cp -R "/cygdrive/c/crash"
/cygdrive/f/$dir_name
cp -R "/cygdrive/c/xampp/htdocs"
/cygdrive/f/$dir_name
cp -R "/cygdrive/c/Documents and Settings/root/Application
Data/Thunderbird" /cygdrive/f/$dir_name
cp -R "/cygdrive/c/Documents and Settings/root/Application Data/Notepad++"
/cygdrive/f/$dir_name
cp -R "/cygdrive/c/Documents and Settings/root/Application Data/ieSpell"
/cygdrive/f/$dir_name
cp -R "/cygdrive/c/Documents and Settings/root/Application Data/Mozilla"
/cygdrive/f/$dir_name
cp -R "/cygdrive/c/Documents and Settings/All Users/Favorites"
/cygdrive/f/$dir_name
cp -R "/cygdrive/c/Documents and Settings/root/Favorites"
/cygdrive/f/$dir_name
cp -R "/cygdrive/c/Documents and Settings/root/My Documents"
/cygdrive/f/$dir_name
cp -R "/cygdrive/c/Documents and Settings/root/Templates"
/cygdrive/f/$dir_name
cp -RP "/cygdrive/c/Documents and Settings/root/Desktop"
/cygdrive/f/$dir_name
cp -R "/cygdrive/c/Documents and Settings/root/Cookies"
/cygdrive/f/$dir_name
cp -R /home/root/bin /cygdrive/f/$dir_name/cygwin
cp -R /home/root/scripts /cygdrive/f/$dir_name/cygwin
cp -R /home/root/.bash_profile /cygdrive/f/$dir_name/cygwin
cp -R /home/root/.bashrc /cygdrive/f/$dir_name/cygwin
cp -R /home/root/.inputrc /cygdrive/f/$dir_name/cygwin
cp -R /home/root/.profile /cygdrive/f/$dir_name/cygwin
cp -R /etc/DIR_COLORS /cygdrive/f/$dir_name/cygwin
cp -R /etc/X11/xinit/xinitrc /cygdrive/f/$dir_name/cygwin
END_TIME=`date +%s` # used to calculate elapsed time
# end time
echo -en "\t End time:\t $YELLOW`date +%Y-%m-%d_%H.%M.%S`$OFF\n"
# screen
echo "End time: `date +%Y-%m-%d_%H.%M.%S`" >>
/cygdrive/f/$dir_name/logfile.txt # log file
ELAPSED_MINUTES=`echo $((($END_TIME-$START_TIME)/60))`
# elapsed time
echo -en "\t Elapsed minutes: $BLUE$ELAPSED_MINUTES$OFF\n\n"
# screen
echo "Elapsed minutes: $ELAPSED_MINUTES" >>
/cygdrive/f/$dir_name/logfile.txt # log file
--
View this message in context: http://old.nabble.com/Script-to-save-XP-Win-stuff-tp30494313p30494313.html
Sent from the Cygwin list mailing list archive at Nabble.com.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple