Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Mepis 3.4.3 , Ubuntu & Damm Small Linux
Posts: 119
Rep:
Firefox and Thunderbird backup script
If i have put this in the wrong place sorry..
I'm looking for some advice on a bash type script, and if anyone else knows how to do this..
I find myself flitting between different Linux distros month to month, in an effort to find, and experiment the pros and cons of each distro.. in doing so, i'm a bit mercenary, and just Wipe off the old distro and start again...
I loose my email contacts, and web browser bookmarks however each time i do this...
I use Firefox and Thunderbird as my apps of choce, and Firefox has the ability to export the contacts as HTML file and Thunderbird has the ability to export the contacts for me...
Is it possible to write a script, which can export the required information from these apps and then backthem up to a memory stick or a webpage, The script could be timed via cron..
I'm using Mepis right now,
Alternativly, i have just got Damm Small Linux working on my 512Mb Memory stick, So i suppose i could in theroy set my meory stick up as my home directory, and then the .thunderbird and .firefox folders could save there automatically, and i could run thunderbird and firefox straight from the stick on my login, and then all the info would be ther automatically..
Is it possible in linux to setup a folder on a meory stick to be the home folder? and have a backup home folder incase the memory stick is not inserted?
It is entirely possible, and I do this almost everyday. I use rsync to backup specific directories in my user's home directory to both a usb stick and another hard drive. The script is easy to read and change to suite your needs. What I end up doing is placing the script in /usr/local/bin and symlinking it to a name that's easy to remember like "usb-backup" or something like that. You will need to install rsync if it is not installed already. One thing about Firefox - you may not want to backup the ~/.mozilla directory because you are then backing up your browser cache also. Cache can grow and is pointless to save. The bookmarks are located here: ~/.mozilla/firefox/some weird name.default/bookmarks.html. I did not write this script, but got it from somewhere a couple of years ago. Rsync works great because it only backs up the differences between the original and the backup, saving time. Here is the code from the script:
Code:
#!/bin/sh
# backup.sh -- backup to a local drive using rsync
# Directories to backup. Separate with a space. Exclude trailing slash!
SOURCES="/home/paul/Articles /home/paul/backup /home/paul/notes /home/paul/documents /home/paul/projects /home/paul/school /home/paul/.evolution "
# Directory to backup to. This is where your backup(s) will be stored.
TARGET="/media/disk/HomeBackup/"
# Your EXCLUDE_FILE tells rsync what NOT to backup. Leave it unchanged if you want
# to backup all files in your SOURCES. If performing a FULL SYSTEM BACKUP, ie.
# Your SOURCES is set to "/", you will need to make use of EXCLUDE_FILE.
# The file should contain directories and filenames, one per line.
# An example of a EXCLUDE_FILE would be:
# /proc/
# /tmp/
# /mnt/
# *.SOME_KIND_OF_FILE
#EXCLUDE_FILE="/home/paul/exclude_file.txt"
# Comment out the following line to disable verbose output
VERBOSE="-v"
###########################
if [ -f $EXCLUDE_FILE ]; then
EXCLUDE="--exclude-from=$EXCLUDE_FILE"
fi
for source in $SOURCES; do
if [ ! -d $TARGET/$source ]; then
mkdir -p $TARGET$source
fi
rsync $VERBOSE $EXCLUDE -a --delete $source/ $TARGET/$source/ >> /home/paul/backuplog.log
done
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.