You are not logged in.
Hopefully I'm not spamming..
With the new Statler images coming in, I guess many would like to install from ISO image. Good thing but what about the zillion customization done to the UI look and feel. And not to mention important stuff like Iceweasel profiles, Evolution data etc.,
Is there an application (hopefully there is...) to do the job? for now, I wrote a simple shell script and I intend to add to it everytime I do some customization. I invite people to add to the list on what else is needed according to them. Script to be run from home directory.
backupscript.sh
mkdir configbackup && cd configbackup
# Hidden directories backup
cp -r ../.config .
cp -r ../.gnome2 .
cp -r ../.mozilla .
cp -r ../.evolution .
## How to get the wine menu in lxpanel after copying this folder?
cp -r ../.wine .
# Regular directories backup
cp -r ../PDF .
cp -r ../htdocs .
# Files
cp ../.conkyrc .
My Rig: Thinkpad T60p (soon to be refreshed to Thinkpad W510), 2G DDR2, 100G HDD, Running @#! Statler A2 (squeeze) dual booting with Win 7. I use @#! for all purposes (MS Office for office work running in wine and Evolution with Exchange plugin for email)
Offline
I use a script as well though with full paths:
cp -avr /home/kevin/.config/awesome /media/Linux/Dropbox/Settings/Linux/home/kevin/.config
cp -avr /home/kevin/.config/clipit /media/Linux/Dropbox/Settings/Linux/home/kevin/.config
cp -avr /home/kevin/.config/geany /media/Linux/Dropbox/Settings/Linux/home/kevin/.config
cp -avr /home/kevin/.config/gnome-mplayer /media/Linux/Dropbox/Settings/Linux/home/kevin/.configI do not know of a backup program that can backup settings just based on program name though. Usually people know what folders to backup or they backup their entire home folder.
Note: ** Please read before posting **
BTW if you wish to contact me, send me an e-mail instead of a PM.
Offline
Curious why "cp"?
Compressed files are smaller:
tar cvpzf config_backup_`date +%Y.%m.%d-%R`.tgz
tar cvpzf home_backup_`date +%Y.%m.%d-%R`.tgz
tar cvpzf root_backup_`date +%Y.%m.%d-%R`.tgz#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
I just use cp because I'm copying individual files/folders. I also have a script to restore back the files using cp.
Note: ** Please read before posting **
BTW if you wish to contact me, send me an e-mail instead of a PM.
Offline
@Sector11,
guess each man chooses his own poison 
but here, the idea is not to take regular backups like you do using a timestamp in the file name. Its a evolving process where I keep adding stuff to the checklist so I'm not caught with my proverbial pants down when I have to shift images/system. Incidentally, I'm awaiting my new W510 and I seriously don't want to spend hours reconfiguring look & feel (it takes hours for me due to the indecision bug). After a lifetime of trying zillion UI changes, I've settled on all fronts and look to actually do some production 
@anonymous,
just thinking aloud if something can be done about this? like a dropbox?
[edit]
on second thought, a windoze style 'send to -> backup bin' context menu option?
Last edited by aravinthrk (2010-12-08 16:23:09)
My Rig: Thinkpad T60p (soon to be refreshed to Thinkpad W510), 2G DDR2, 100G HDD, Running @#! Statler A2 (squeeze) dual booting with Win 7. I use @#! for all purposes (MS Office for office work running in wine and Evolution with Exchange plugin for email)
Offline
Actually I use both methods, "cp" and "tar"
I've gone from:
#!/bin/bash
cp -R --update --preserve "/home/sector11/.claws-mail" "/media/7/home-bkup"
cp -R --update --preserve "/home/sector11/.mozilla" "/media/7/home-bkup"to this:
#!/bin/bash
# inspired by aravinthrk & anonymous
# http://crunchbanglinux.org/forums/topic/10436/backup-script-to-snapshot-existing-configs/
mkdir /media/7/cb10-home_copy/`date +%Y.%m.%d`
# Hidden Directories
cp -avru "/home/sector11/.claws-mail" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.config" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.fontconfig" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.dropbox" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.dropbox-dist" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.fonts" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.gftp" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.homebank" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.icedove" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.icons" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.jpilot" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.mozilla" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.themes" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.when" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
# Visible Directories
cp -avru "/home/sector11/bin" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Conky" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Conky_PitStop" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/HomeBank" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/images" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Mail" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/projects" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Websites" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
# Files
cp -avru "/home/sector11/.bashrc" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.clawsmail" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.conkyForecast.config" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.Xauthority" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.Xdefaults" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"just from reading this thread.
Now I have to figure a way to so something like this:
===========
if exist: /media/7/cb10-home_copy/`date +%Y.%m.%d`
cp cpmmands
else
mkdir /media/7/cb10-home_copy/`date +%Y.%m.%d`
cp commands
so the -u function works if I "need" to make a second backup on the same day.
Gotta check the bash manual on that one 
I keep a few copies around ... just in case! Saved my bacon more than once because of that too!
PS: @ anonymous: 18 hours and running 
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
@ sector11
#!/bin/bash
if [ -d /some/dir/path ] ; then
echo "It exists."
else
echo "It doesn't exist."
fii know about these:
"-d" true if directory exists
"-r" true if file is readable
"-x" true if file is executable
"-f" true if file is a regular file
you can find them all in the manpage for bash if you look for the section "CONDITIONAL EXPRESSIONS"
cheers
luc
Offline
@ sector11
#!/bin/bash if [ -d /some/dir/path ] ; then echo "It exists." else echo "It doesn't exist." fii know about these:
"-d" true if directory exists
"-r" true if file is readable
"-x" true if file is executable
"-f" true if file is a regular file
you can find them all in the manpage for bash if you look for the section "CONDITIONAL EXPRESSIONS"
cheers
luc
Thanks luc
I went looking (http://ss64.com/bash/) and found no "if, then else" stuff I did get this far though:
cd /media/7/cb10-home_copy/`date +%Y.%m.%d` || mkdir /media/7/cb10-home_copy/`date +%Y.%m.%d` from the man pages, but had to do some "real life" things ... but it comes with a ton of what looks like "oh oh, that's not right!" stuff if the directory exists 
I'll play more now. Thanks.
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
Sector11,
i recall seeing a bash guide book advertised in distrowatch.com free book listing... check it out. and yes, bash has a right proper if else construct... check our very own 'cb-welcome' script for reference
that man has written some mean script over there.
My Rig: Thinkpad T60p (soon to be refreshed to Thinkpad W510), 2G DDR2, 100G HDD, Running @#! Statler A2 (squeeze) dual booting with Win 7. I use @#! for all purposes (MS Office for office work running in wine and Evolution with Exchange plugin for email)
Offline
Sector11,
i recall seeing a bash guide book advertised in distrowatch.com free book listing... check it out. and yes, bash has a right proper if else construct... check our very own 'cb-welcome' script for reference
that man has written some mean script over there.
Yea, I've seen it at DistroWatch but when it came to this:
Complete and verifiable information is required in order to receive this Guide.
First Name:
Last Name:
Job Title:
Company Name:
Business Email:
Phone:
Fax:
Division/Mail Stop:
Street Address:
City:
State/Province: Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming American Samoa Guam Marshall Islands Micronesia (Federated States of) Palau Puerto Rico U.S. Minor Outlying Islands U.S. Virgin Islands Northern Mariana Islands Armed Forces Americas AA Armed Forces Middle East, Europe, Canada AE Armed Forces Pacific AP Alberta British Columbia Manitoba New Brunswick Newfoundland and Labrador Nova Scotia Northwest Territories Nunavut Ontario Prince Edward Island Quebec Saskatchewan Yukon Territory Aguascalientes Baja California Baja California Sur Campeche Chiapas Chihuahua Coahuila Colima Distrito Federal Durango Guanajuato Guerrero Hidalgo Jalisco Mexico State Michoacan Morelos Nayarit Nuevo Leon Oaxaca Puebla Queretaro Quintana Roo San Luis Potosi Sinaloa Sonora Tabasco Tamaulipas Tlaxcala Veracruz Yucatan Zacatecas
Postal/ZIP Code:
Country:
Yes, please auto-fill my contact information for other qualification forms.... i backed down. I don't live in any of those States/Provinces (or either Country for that matter)
Job Title: no job
Company Name: no company
Business Email: none
Phone: none
Fax: none
Division/Mail Stop: noneObviously they are not free for everyone.
I am collecting website links for Bash Scripting now.
BTW, your tip helped:
#!/bin/bash
# -d file
# True if file exists and is a directory.
if [ -d /media/7/cb10-home_copy/`date +%Y.%m.%d` ] ; then
echo "It exists."
# Hidden Directories
cp -avru "/home/sector11/.claws-mail" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.config" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.fonts" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.gftp" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.icedove" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.icons" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.jpilot" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.mozilla" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.themes" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.when" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
# Visible Directories
cp -avru "/home/sector11/bin" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Conky" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/conky" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Conky_PitStop" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/HomeBank" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/images" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Mail" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/projects" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Websites" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
# Files
cp -avru "/home/sector11/.bashrc" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.conkyForecast.config" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.Xauthority" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.Xdefaults" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
echo "Home Directory now updated."
else
echo "Directory doesn't exist - creating it."
mkdir /media/7/cb10-home_copy/`date +%Y.%m.%d`
# Hidden Directories
cp -avru "/home/sector11/.claws-mail" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.config" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.fonts" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.gftp" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.icedove" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.icons" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.jpilot" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.mozilla" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.themes" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.when" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
# Visible Directories
cp -avru "/home/sector11/bin" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Conky" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/conky" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Conky_PitStop" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/HomeBank" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/images" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Mail" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/projects" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/Websites" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
# Files
cp -avru "/home/sector11/.bashrc" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.conkyForecast.config" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.Xauthority" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
cp -avru "/home/sector11/.Xdefaults" "/media/7/cb10-home_copy/`date +%Y.%m.%d`"
fi
echo " "
echo "Done"Did it once got everything, added a couple of images to ~/images and did it again. In seconds it was done and the new images were there. Love that -u factor!
Thanks
Last edited by Sector11 (2010-12-09 13:40:41)
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
^ I didn't have a problem downloading the book... not sure if it ok to share... otherwise I would... lemme know
My Rig: Thinkpad T60p (soon to be refreshed to Thinkpad W510), 2G DDR2, 100G HDD, Running @#! Statler A2 (squeeze) dual booting with Win 7. I use @#! for all purposes (MS Office for office work running in wine and Evolution with Exchange plugin for email)
Offline
^ I didn't have a problem downloading the book... not sure if it ok to share... otherwise I would... lemme know
Boy now that sounds like things done in my Windows days 
"Hey, Joe, can I get a copy of that?"

You have a PM !
Last edited by Sector11 (2010-12-09 14:31:16)
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
@sector11 -- Like the idea. I made a few changes so it's a bit shorter, and also is easy for others to use by just editing two variables at the top (Backup location and date format.) It also autodetects the user -- handy for multi-user systems.
#!/bin/bash
# -d file
# True if file exists and is a directory.
HOMECOPYPATH="/media/7/cb10-home_copy/"
CONFIGDATE="`date +%Y.%m.%d`"
if [ -d $HOMECOPYPATH/$CONFIGDATE ] ; then
echo "It exists."
else
echo "Directory doesn't exist - creating it."
mkdir $HOMECOPYPATH/$CONFIGDATE
fi
# Hidden Directories
cp -avru "/home/$USER/.claws-mail" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.config" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.fonts" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.gftp" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.icedove" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.icons" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.jpilot" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.mozilla" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.themes" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.when" "/media/7/cb10-home_copy/$CONFIGDATE"
# Visible Directories
cp -avru "/home/$USER/bin" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/Conky" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/conky" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/Conky_PitStop" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/HomeBank" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/images" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/Mail" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/projects" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/Websites" "/media/7/cb10-home_copy/$CONFIGDATE"
# Files
cp -avru "/home/$USER/.bashrc" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.conkyForecast.config" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.Xauthority" "/media/7/cb10-home_copy/$CONFIGDATE"
cp -avru "/home/$USER/.Xdefaults" "/media/7/cb10-home_copy/$CONFIGDATE"
echo "Home Directory now updated."
echo "Done"IRC: PizzaAndWine Script bits: Incremental Backup | Sleep Timer
Offline
funny u shud remind me of windows.. i've forgotten the presence of the dual bootin win7 in my rig... more and more of my mates are getting impressed with what i'm able to do with linux... vive la OSS 
My Rig: Thinkpad T60p (soon to be refreshed to Thinkpad W510), 2G DDR2, 100G HDD, Running @#! Statler A2 (squeeze) dual booting with Win 7. I use @#! for all purposes (MS Office for office work running in wine and Evolution with Exchange plugin for email)
Offline
Shouldn't you replace all the /media/7/cb10-home_copy/ with $HOMECOPYPATH?
Note: ** Please read before posting **
BTW if you wish to contact me, send me an e-mail instead of a PM.
Offline
@sector11 -- Like the idea. I made a few changes so it's a bit shorter, and also is easy for others to use by just editing two variables at the top (Backup location and date format.) It also autodetects the user -- handy for multi-user systems.
WOW!!!! Not only multi-user systems but by "anyone"! Now that is good ... and a LOT shorther!
Shouldn't you replace all the /media/7/cb10-home_copy/ with $HOMECOPYPATH?
I though something similar "Wonder why he didn't use it there?"
But sure looks good!
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
One more thing: I don't think the r flag is needed to copying files.
Note: ** Please read before posting **
BTW if you wish to contact me, send me an e-mail instead of a PM.
Offline
Shouldn't you replace all the /media/7/cb10-home_copy/ with $HOMECOPYPATH?
Yes...yes you should. My bad.
IRC: PizzaAndWine Script bits: Incremental Backup | Sleep Timer
Offline
One more thing: I don't think the r flag is needed to copying files.
Yea, it not like there are sub-files!
hahahahahaha - hey, I'm learning yesterday this green bean was planted and watered
... today I'm digging my way to sunlight!.
Or as vastOne once said::
Baby step, baby steps!
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
funny u shud remind me of windows.. i've forgotten the presence of the dual bootin win7 in my rig... more and more of my mates are getting impressed with what i'm able to do with linux... vive la OSS
Hahahahahahaha ... I use Linux because Win2K gave me one to many "Bluescreen of Death" telling me my 6 month old 80GB WesterDigital HD was "DEAD". Wouldn't even reinstall!
Ubuntu/Xubuntu used that drive for another 2 years before I went SATA, and a few weeks ago I dug it outta mothballs and installed it on mom-in-laws OLD Compaq running Slitaz Linux.
What I know compared to the people here would fit in on a thumbnail in mono font @ 8px, but I'm the family computer guru because I build my own and run Linux. Go figure!
PLEASE don't tell them, I'm basking in the glory!

#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
anonymous wrote:Shouldn't you replace all the /media/7/cb10-home_copy/ with $HOMECOPYPATH?
Yes...yes you should. My bad.
I took anonymous suggestion, my "???" and did it anyway.
#!/bin/bash
# inspired by mdpalow, aravinthrk, anonymous & jmbarnes
# http://crunchbanglinux.org/forums/topic/10436/backup-script-to-snapshot-existing-configs/
# -d file
# True if file exists and is a directory.
HOMECOPYPATH="/media/7/cb10-home_copy"
CONFIGDATE="`date +%Y.%m.%d`"
if [ -d $HOMECOPYPATH/$CONFIGDATE ] ; then
echo "It exists."
else
echo "Directory doesn't exist - creating it."
mkdir $HOMECOPYPATH/$CONFIGDATE
fi
# Hidden Directories
cp -avru "/home/$USER/.claws-mail" "$HOMECOPYPATH/$CONFIGDATE"
cp -avru "/home/$USER/.config" "$HOMECOPYPATH/$CONFIGDATE"
cp -avru "/home/$USER/.fonts" "$HOMECOPYPATH/$CONFIGDATE"
{snip}and it works GREAT!
I've also looked at your two links in your sig ... 
@ anonymous
And yes, the files section are no longer looking for sub-files 
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
What will be in the target directory if it exists? Will you overwrite important backup files there? If so I would recommend some different behavior if the dir exists. If it does not matter if we overwrite stuff in already existing directories you can use
mkdir -p path/to/newdirto check and create the dir if it does not exist.
(read "man mkdir" for more info)
luc
Offline
What will be in the target directory if it exists? Will you overwrite important backup files there? If so I would recommend some different behavior if the dir exists. If it does not matter if we overwrite stuff in already existing directories you can use
mkdir -p path/to/newdirto check and create the dir if it does not exist.
(read "man mkdir" for more info)luc
If it doesn't exist it is created and the files copied.
If it does exist it's because the script has been run at least once today and if you have added NOTHING, or changed nothing - nothing happens-
cp
-a, --archive
same as -dR --preserve=all
-d
same as --no-dereference --preserve=links
-u, --update
copy only when the SOURCE file is newer than the destination
file or when the destination file is missing
-R, -r, --recursive
copy directories recursively (probably not needed. See -a)
-v, --verbose
explain what is being doneHowever if you add 6 images to ~/images and edit the calendar in ~/.when and run the script a second time on the same day, that -u kicks in, cp will NOT copy over files that are the same, it will add the six images and copy the updated calendar in ~/.when
Last edited by Sector11 (2010-12-09 18:18:41)
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
Hahahahahahaha ... I use Linux because Win2K gave me one to many "Bluescreen of Death" telling me my 6 month old 80GB WesterDigital HD was "DEAD". Wouldn't even reinstall!
Wow... w2k? that's like stone age man... refreshing though when one was using 95/98.
[edit] i had to add this... couldn't resist.... 'mv "refreshing though when one was using 95/98." "refreshing though when one was using 95/98 OR god forbid a commodore 64"' 
What I know compared to the people here would fit in on a thumbnail in mono font @ 8px, but I'm the family computer guru because I build my own and run Linux. Go figure!
PLEASE don't tell them, I'm basking in the glory!
![]()
![]()
I won't.. if you won't

Last edited by aravinthrk (2010-12-10 04:05:18)
My Rig: Thinkpad T60p (soon to be refreshed to Thinkpad W510), 2G DDR2, 100G HDD, Running @#! Statler A2 (squeeze) dual booting with Win 7. I use @#! for all purposes (MS Office for office work running in wine and Evolution with Exchange plugin for email)
Offline
I won't.. if you won't
![]()
![]()
Hogan's Heros
Shultz: I see nothing, I hear nothing, I know nothing! 
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.