LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-12-2014, 12:54 PM   #1
mikedelo
Member
 
Registered: Mar 2004
Location: Staten Island, NY
Distribution: MX Linux
Posts: 63

Rep: Reputation: 0
External HDD Backup


Hello,

I would like to keep my externall HDD connected and have my HOME directory and my email setttings (I use Thunderbird) backed up automatically. Is this possible?
 
Old 04-12-2014, 03:26 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Yep,

There are backup apps but most people might set up a cron job that has a batch file to run rsync.

You could get wild and run some advanced filesystem too.

I'm sure others have their favorite way also. They might add to the answer.
 
1 members found this post helpful.
Old 04-13-2014, 07:03 PM   #3
mikedelo
Member
 
Registered: Mar 2004
Location: Staten Island, NY
Distribution: MX Linux
Posts: 63

Original Poster
Rep: Reputation: 0
Thanks for your reply!

Which of the backup apps is preferred?
 
Old 04-13-2014, 08:14 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
BackinTime is a highly recommended frontend for rsync.

Dmitri reviewed it on Sourcetrunk several years ago.

However, I would recommend setting up a script with rsync. Here's an example based on my own backup script, which backs up across my home network to my file server:

Code:
#!/bin/bash
rsync -ar /home/[username] [username]@[target ip]:/path/to/somedirectory
Modifying the target path appropriately should make it work to an external drive.

I don't run it as a cron job because, on my home system, I don't make significant changes that often; I run it when I have made changes worth backing up.
 
1 members found this post helpful.
Old 04-13-2014, 09:23 PM   #5
mikedelo
Member
 
Registered: Mar 2004
Location: Staten Island, NY
Distribution: MX Linux
Posts: 63

Original Poster
Rep: Reputation: 0
A few things....

What is rsync and cron?

Also, when you say script, do you mean it will copy files from my HOME directory to the external HDD? So if I were to take the HDD with me to another computer, all I would see is an exact copy of my HOME directory and not a backup file?
 
Old 04-13-2014, 09:46 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
rsync stands for remote sync. It's a file copy utility that goes one step further and compares the files at the source and destination before copying. This makes it perfect for backup applications, because the first time you run it it will take forever copying everything over, but any subsequent time you run it it will just copy over those files that have changed since the last copy.

cron is like Windows' Scheduled Tasks. It's a way to schedule programs/commands, such as running your backup utility at 4am every tuesday, or whatever you might want to do.

Yes if you plugged the external hard drive into another computer you would see all of your files as expected.

I perform my backups using rsync on a cron job to copy to two external USB drives. Works great.
 
2 members found this post helpful.
Old 04-19-2014, 08:01 AM   #7
mikedelo
Member
 
Registered: Mar 2004
Location: Staten Island, NY
Distribution: MX Linux
Posts: 63

Original Poster
Rep: Reputation: 0
The rsync program worked great! Two additional questions....

1) I would like to back up my email program, Thunderbird. Is the data stored in my HOME directory? If so, does simply copying the files act as my backup or do I need to take additional steps?

2) I did a comparison between the destination copy and the source directory. There is a large difference in both file count and size. I found the difference to be in the directories that start with a dot, for example, ".themes" or ".ssh". Why didn't these files transfer over?

Thanks!

Mike
 
Old 04-19-2014, 09:35 AM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
2) How did you do the rsync? Did you rsync the directory itself, or all files in the directory by using a wildcard ('*')?
 
1 members found this post helpful.
Old 04-20-2014, 12:04 PM   #9
mikedelo
Member
 
Registered: Mar 2004
Location: Staten Island, NY
Distribution: MX Linux
Posts: 63

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by suicidaleggroll View Post
2) How did you do the rsync? Did you rsync the directory itself, or all files in the directory by using a wildcard ('*')?
I used a program called LukcyBackUp. I set it up to sync the destination and source. How do I add the wildcard attribute?
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2014-04-20 13:03:07.png
Views:	10
Size:	26.9 KB
ID:	15291  
 
Old 04-20-2014, 01:21 PM   #10
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
I thought from your post that you had used rsync, in which case I would have been able to provide some suggestions. I know nothing about that backup utility, however.
 
1 members found this post helpful.
Old 04-20-2014, 08:11 PM   #11
mikedelo
Member
 
Registered: Mar 2004
Location: Staten Island, NY
Distribution: MX Linux
Posts: 63

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by suicidaleggroll View Post
I thought from your post that you had used rsync, in which case I would have been able to provide some suggestions. I know nothing about that backup utility, however.
I am sorry. I wanted to use rsync. But when I went to my package manager, all I found was Luck Back Up. :-) In fact, I just went in to take a screen shot for you, but I cannot even find it. I did find a grsync. How do I find regular rsync?
 
Old 04-20-2014, 09:56 PM   #12
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by mikedelo View Post
I am sorry. I wanted to use rsync. But when I went to my package manager, all I found was Luck Back Up. :-) In fact, I just went in to take a screen shot for you, but I cannot even find it. I did find a grsync. How do I find regular rsync?
99.999% chance it was already installed on your system before you even went looking for a backup utility. I have never seen a modern Linux distro that didn't come with rsync pre-installed.

Last edited by suicidaleggroll; 04-20-2014 at 09:57 PM.
 
1 members found this post helpful.
Old 04-21-2014, 09:35 PM   #13
mikedelo
Member
 
Registered: Mar 2004
Location: Staten Island, NY
Distribution: MX Linux
Posts: 63

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by suicidaleggroll View Post
99.999% chance it was already installed on your system before you even went looking for a backup utility. I have never seen a modern Linux distro that didn't come with rsync pre-installed.
You're right. I typed rsync in the terminal. What command do I type to copy everything from my home directory to my external hard drive.

Also, what about backing up my email program, Thunderbird?

Thanks so much for helping me do this!
 
Old 04-21-2014, 10:44 PM   #14
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
rsync -a /home/user /mnt/drive

Replacing /home/user with your home directory, and replacing /mnt/drive with the location of your external hard drive.

rsync is very particular when it comes to trailing slashes on the source though, so bear that in mind.
/home/user means sync user and all of its contents to the destination location
/home/user/ means sync user's contents, but not the directory user itself, to the destination location

A subtle, but important difference

/home/user/* would sync every visible directory in user to the destination (directories with a leading . are "hidden" and skipped by the "*" wildcard).

As for Thunderbird, I'm not sure. All of Thunderbird's files are stored in the /home/user/.thunderbird directory, but I'm not sure if simply making a copy of this directory is sufficient or how you would recover the data.
 
Old 04-22-2014, 07:20 PM   #15
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
rsync is likely already installed on your system; it's a basic Linux command that ships with most distros--every one that I've ever used. If you open a terminal, enter man rsync, and see a man page, it's already there.

Your Thunderbird mail store is in your home directory. This article should help: http://kb.mozillazine.org/Profile_folder_-_Thunderbird

When I back up my home folder with rsync with the command in post #4 above, it captures all the hidden files and directories, where configuration data, mail store, and so on, are stored.

Last edited by frankbell; 04-22-2014 at 07:22 PM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting Problem. Windows and ubuntu on internal hdd. Centos on External USB hdd faisal59 Linux - Distributions 1 07-17-2013 08:19 AM
Slow USB transfer rates (60kb p/s) External HDD --> Internal HDD drfrostbyte Linux - Hardware 4 03-28-2011 01:20 AM
I installed ubuntu 9.04 to my Maxtor external hdd. I have no internal hdd. I can boot dont33 Linux - Newbie 1 08-13-2009 04:13 PM
Which filesystem for external HDD (backup) Braqoon Linux - General 17 01-07-2009 09:07 AM
Formatting external hdd as backup to 2 hdd's balch4 Linux - Desktop 2 12-04-2006 11:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:02 PM.

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