LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I need a simple backup for Home folder (https://www.linuxquestions.org/questions/linux-newbie-8/i-need-a-simple-backup-for-home-folder-4175685769/)

Gregg Bell 11-24-2020 09:36 PM

I need a simple backup for Home folder
 
I had Back In Time and it works great until it doesn't. Free File Sync seems like it would be good but it often finds files it can't sync for some reason. I tried Kbackup. They said it was easy. It's not. At least not for me. I ran it for hours and when the Home folder was finally copied the screen froze. Then I finally learned how to untar the tar file and there was nothing in the file. (Admittedly, I may have done something wrong.)Grsync seems powerful but I get confused with "verbose" and all that stuff. Anyway, there's got to be something simple. All I would ask is that it be able to do incremental changes. I don't need old versions or anything like that. Thank you.

frankbell 11-24-2020 09:55 PM

I use rsync with the -a (for archive) argument. Here's my little script:

Code:

rsync -a [/path/to/home] /media/sdb1/backups

I understand that Back in Time is a front end for rsync, So it might help it you told us more about how Back in Time has misbehaved.

Gregg Bell 11-24-2020 10:12 PM

Quote:

Originally Posted by frankbell (Post 6188612)
I use rsync with the -a (for archive) argument. Here's my little script:

Code:

rsync -a [/path/to/home] /media/sdb1/backups
I understand that Back in Time is a front end for rsync, So it might help it you told us more about how Back in Time has misbehaved.

Thanks Frank. Back In Time will just throw errors at me sometimes. It's a really good program, though. I don't mean to dis it. The latest thing was it was saying the receiving usb didn't have enough space.

Anyway, I was looking over the directions for grsync and I'm starting to think that might work for me. (It's not as complicated as it seems.)

So in your command sdb1 is a usb drive? What does your command actually do? (I'm still not real comfortable doing stuff like that in the terminal, though.)

evo2 11-24-2020 11:49 PM

Hi,
Quote:

Originally Posted by Gregg Bell (Post 6188614)
Thanks Frank. Back In Time will just throw errors at me sometimes. It's a really good program, though. I don't mean to dis it. The latest thing was it was saying the receiving usb didn't have enough space.

Well, that last one sounds like a fairly straight forward error to understand.

Quote:

Originally Posted by Gregg Bell (Post 6188614)
Anyway, I was looking over the directions for grsync and I'm starting to think that might work for me. (It's not as complicated as it seems.)

So in your command sdb1 is a usb drive? What does your command actually do? (I'm still not real comfortable doing stuff like that in the terminal, though.)

It is wherever you want to backup your files to - so in your case probably a usb drive.

If you were mostly happy with Back In Time, perhaps people here could help you with whatever problems you had with it.
Rolling your own backup solution if you're not comfortable with the commandline could be a bit of a headache.

Evo2.

rnturn 11-25-2020 12:13 AM

Quote:

Originally Posted by Gregg Bell (Post 6188614)
Back In Time will just throw errors at me sometimes. It's a really good program, though. I don't mean to dis it. The latest thing was it was saying the receiving usb didn't have enough space.

What did "df <receiving-usb-device>" return after that message was seen?

I've never used "Back In Time" so I wonder: does it save copies of the source trees in point-in-time directories? (Ah... I checked the documentation and it looks like this may very well be the case.) If so, perhaps there's too many of the older snapshots and insufficient space for another. Did that error message appear immediately or early in the backup process? (Perhaps BIT scanned your hard disk and determined that the number of files to be backed up exceeded the remaining space on the USB drive and threw up its hands before doing anything.) After it had been running for a while? (It was backing up but simply ran out of space while performing the backup.)

All of that would be helpful to know.

Also, I'd try cleaning up old cruft like browser caches and thumbnails and trying again. If that works, perhaps BIT allows you to specify "backup up everything except that... and that... and..." (You get the idea.)

HTH...

ondoho 11-25-2020 12:29 AM

Quote:

Originally Posted by Gregg Bell (Post 6188607)
I had Back In Time and it works great until it doesn't. Free File Sync seems like it would be good but it often finds files it can't sync for some reason. I tried Kbackup. They said it was easy. It's not. At least not for me. I ran it for hours and when the Home folder was finally copied the screen froze. Then I finally learned how to untar the tar file and there was nothing in the file. (Admittedly, I may have done something wrong.)Grsync seems powerful but I get confused with "verbose" and all that stuff. Anyway, there's got to be something simple. All I would ask is that it be able to do incremental changes. I don't need old versions or anything like that. Thank you.

All this sounds like you need to solve the problems you listed instead of dismissing them.
In other words, what if we recommend "something else" and it "works until it doesn't" (great problem description btw)?

Gregg Bell 11-25-2020 11:37 AM

Quote:

Originally Posted by evo2 (Post 6188628)
Hi,

Well, that last one sounds like a fairly straight forward error to understand.

Thanks Evo2. Yeah, it seems that way but it wasn't. There was plenty of room on the USB drive. What happened is as soon as I took another "snapshot" these black squares started filling the computer screen saying there wasn't enough room. I'd run into that problem before, and as I recall I had to go to the dev in Github to solve it.

Quote:

Originally Posted by evo2 (Post 6188628)


It is wherever you want to backup your files to - so in your case probably a usb drive.

If you were mostly happy with Back In Time, perhaps people here could help you with whatever problems you had with it.
Rolling your own backup solution if you're not comfortable with the commandline could be a bit of a headache.

Evo2.

Yeah, I'm staying away from the commandline. It's like Universal replace in LO or Word. Too risky. (Too much power in the hands of somebody as impatient as me.)

Gregg Bell 11-25-2020 11:43 AM

Quote:

Originally Posted by rnturn (Post 6188634)
What did "df <receiving-usb-device>" return after that message was seen?

I've never used "Back In Time" so I wonder: does it save copies of the source trees in point-in-time directories? (Ah... I checked the documentation and it looks like this may very well be the case.) If so, perhaps there's too many of the older snapshots and insufficient space for another. Did that error message appear immediately or early in the backup process? (Perhaps BIT scanned your hard disk and determined that the number of files to be backed up exceeded the remaining space on the USB drive and threw up its hands before doing anything.) After it had been running for a while? (It was backing up but simply ran out of space while performing the backup.)

All of that would be helpful to know.

Also, I'd try cleaning up old cruft like browser caches and thumbnails and trying again. If that works, perhaps BIT allows you to specify "backup up everything except that... and that... and..." (You get the idea.)

HTH...

Thanks rnturn. I was definitely short on trying to figure it out. There was only one snapshot on the USB so there was plenty of room (I've had up to seven). I had run into the problem before and knew that the fix was pretty involved and just wasn't up for it. The thing is I don't really need anything more than the current Home folder backed up. In fact, when BIT gets a few snapshots on it it gets really slow. I'm trying Grsync right now. I think this might be my answer.

Gregg Bell 11-25-2020 11:46 AM

Quote:

Originally Posted by ondoho (Post 6188641)
All this sounds like you need to solve the problems you listed instead of dismissing them.
In other words, what if we recommend "something else" and it "works until it doesn't" (great problem description btw)?

LOL You mean you needed a better description than that?

I'm running Grsync right now. All I need is one backup. BIT specialized in going back in time. I just want now. We'll see how this goes. I can go back (no pun intended) and figure out BIT if I need to.

jmgibson1981 11-25-2020 12:52 PM

I've been using Duplicity globally by the root crontab. It works fine and I've been able to do simple restorations. My problem is how to restore if I lose the existing directory /home/"$USER"/.cache/duplicity folder. Here is my script.

Code:

#!/bin/sh

desktop_home_dir_func() {
        if [ ! -z "$POOLLOC" ] ; then
                TARGET="$POOLLOC"/backups/homebackups
                if [ "$USER" = root ] ; then
                        HOSTNAME=$(uname -n)
                        for user in /home/* ; do
                                BUSER=$(basename "$user")
                                if [ ! -d "$TARGET"/"$HOSTNAME"/"$BUSER}" ] ; then
                                        mkdir -p "$TARGET"/"$HOSTNAME"/"$BUSER" && chown -R \
                                        "$BUSER":"$BUSER" "$TARGET"/"$HOSTNAME"/"$BUSER"
                                fi
                                su -c "duplicity \
                                --exclude-if-present .nobackup \
                                --no-encryption \
                                --full-if-older-than 1M \
                                /home/${BUSER} file://${TARGET}/${HOSTNAME}/${BUSER}" "$BUSER"
                                su -c \
                                "duplicity remove-all-but-n-full 4 --force \
                                file://${TARGET}/${HOSTNAME}/${BUSER}" "$BUSER"
                        done
                else
                        lsblk | head -n 2 | grep ltsp && HOSTNAME=server || HOSTNAME=$(uname -n)
                        RESTFOLDER=/home/"$USER"/Desktop/RESTORE_DELETE_ASAP
                        duplicity \
                        --no-encryption \
                        --progress \
                        file://"$TARGET"/"$HOSTNAME"/"$USER"/ "$RESTFOLDER"
                        touch "$RESTFOLDER"/.nobackup
                fi
        fi
}


sgosnell 11-25-2020 03:13 PM

Putting a backup of /home in /home is totally useless, just a waste of time and storage space. Backups should go to an external drive, either local, network, or cloud, preferably more than one. I know nothing about duplicity.

jmgibson1981 11-25-2020 03:29 PM

Quote:

Putting a backup of /home in /home is totally useless, just a waste of time and storage space.
If directed at me might you point out the problem in my script. I'd like to it to be perfect. My "$POOLLOC" is an nfs mounted directory from my server.

sgosnell 11-25-2020 03:44 PM

.cache should not be considered as permanent. Anything there is subject to loss. I suggest backing up /home/"$USER"/.cache/duplicity to someplace external to /home. That could be done separately or as part of the normal backup.


All times are GMT -5. The time now is 02:15 AM.