LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 04-24-2006, 05:55 AM   #1
fieldyweb
Member
 
Registered: Jun 2005
Location: Wycombe, England
Distribution: Mepis 3.4.3 , Ubuntu & Damm Small Linux
Posts: 119

Rep: Reputation: 15
Question 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?
 
Old 04-24-2006, 06:10 AM   #2
Sargek
Member
 
Registered: Jan 2003
Location: San Antonio, Texas
Distribution: Debian testing
Posts: 416

Rep: Reputation: 36
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
 
Old 04-24-2006, 07:33 AM   #3
fieldyweb
Member
 
Registered: Jun 2005
Location: Wycombe, England
Distribution: Mepis 3.4.3 , Ubuntu & Damm Small Linux
Posts: 119

Original Poster
Rep: Reputation: 15
Cheers i'll give this a go..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to backup my mails in Thunderbird? anti.corp Debian 1 01-18-2006 12:19 PM
Does Mozilla Thunderbird have Backup Softwares for FC3 nistelrooy Linux - Software 4 04-05-2005 08:12 PM
Thunderbird and Firefox, Thunderbird doesnt launch firefox? sovietpower Slackware 1 11-01-2004 01:51 PM
Backup Emails in Thunderbird IBall Linux - Software 1 02-17-2004 10:53 AM
Thunderbird backup downinthemine Linux - Software 1 12-02-2003 01:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration