Announcement

Collapse
No announcement yet.

Incremental Backups Keeps Getting Errors?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Incremental Backups Keeps Getting Errors?

    I do a daily backup, but after my upgrade to Disco Dingo, I've been getting random errors.

    Click image for larger version

Name:	Screenshot_20190517_160858.jpg
Views:	1
Size:	22.4 KB
ID:	649476

    I use this simple backup script that I made that does the backups (Essentially just does incremental backups with a certain file naming structure to an external drive called "sentinel"):
    Code:
    #!/bin/bash
    
    #Author: Sarah Szabo <SarahSzabo@Protonmail.com>
    #Creation Date: 19/03/2019
    #Version: 1
    
    printf "%s\n\n" "About to Create Snapshots..."
    now="$(date +%d-%m-%Y) $(date +%X)"
    
    #Prefixes
    fsPrefix="/media/sarah"
    systemPrefix="$fsPrefix/Snapshots/System Backups"
    homePrefix="$fsPrefix/Snapshots/Sarah Backups"
    convergentRefugePrefix="$fsPrefix/ConvergentRefuge/Snapshots/Convergent Refuge"
    
    #Subvolume Names
    fsname="$fsPrefix/Lesser Ark Root"
    system="$systemPrefix/System $now"
    home="$homePrefix/Sarah $now"
    convergentRefuge="$convergentRefugePrefix/Convergent Refuge $now"
    sudo mkdir -p "$fsname" "$systemPrefix" "$homePrefix" "$convergentRefugePrefix" 
    sudo mount /dev/sdc2 "$fsname"
    printf "%s\n\n" "Filesystem Mounted on $fsname"
    #printf "sudo btrfs subvolume snapshot -r %s  %s\n\n" "$fsname/@" "$system" 
    sudo btrfs subvolume snapshot -r "$fsname/@" "$system"
    sudo btrfs subvolume snapshot -r "$fsname/@home" "$home"
    sudo btrfs subvolume snapshot -r "/media/sarah/ConvergentRefuge/Convergent Refuge" "$convergentRefuge"
    printf "%s\n\n" "Snapshots Taken!"
    
    #New Snapshots Or Old Ones?
    read -p "Are we doing new snapshots, or going off old ones? (Enter New/Old): " newstatus
    if [[ "$newstatus" == "Old" ]]; then
    
      #Send System Folder to SENTINEL
      printf "%s\n\n" "Date Options Display:"
      ls "$homePrefix"
      read -p "Enter Previous Backup Filename (Just Date/Time): " filename
      sudo btrfs send -p "$systemPrefix/System $filename" "$system" | sudo btrfs receive /media/sarah/SENTINEL/Kubuntu\ Backups/System\ Backups
      printf "\n%s\n\n" "Root System Backed Up"
    
      #Send Home folder
      sudo btrfs send -p "$homePrefix/Sarah $filename" "$home" | sudo btrfs receive /media/sarah/SENTINEL/Kubuntu\ Backups/Sarah\ Backups
      printf "\n%s\n\n" "Sarah's Home Folder Backed Up"
    
      #Send Convergent Refuge Folder
      sudo btrfs send -p "$convergentRefugePrefix/Convergent Refuge $filename" "$convergentRefuge" | sudo btrfs receive /media/sarah/SENTINEL/Kubuntu\ Backups/Convergent\ Refuge\ Backups
      printf "\n%s\n\n" "Convergent Refuge Backed Up"
      printf "\n%s\n\n" "Backing Up Complete"
    
    else
      #Send System Folder to SENTINEL
      sudo btrfs send "$system" | sudo btrfs receive /media/sarah/SENTINEL/Kubuntu\ Backups/System\ Backups
      printf "\n%s\n\n" "Root System (NEW) Backed Up"
    
      #Send Home folder
      sudo btrfs send "$home" | sudo btrfs receive /media/sarah/SENTINEL/Kubuntu\ Backups/Sarah\ Backups
      printf "\n%s\n\n" "Sarah's Home Folder (NEW) Backed Up"
    
      #Send Convergent Refuge Folder
      sudo btrfs send "$convergentRefuge" | sudo btrfs receive /media/sarah/SENTINEL/Kubuntu\ Backups/Convergent\ Refuge\ Backups
      printf "\n%s\n\n" "Convergent Refuge (NEW) Backed Up"
      printf "\n%s\n\n" "Backing Up Complete"
    fi

    #2
    Are you running it as root? Looks like permissions errors to me.

    Please Read Me

    Comment


      #3
      I run the overall script with sudo LesserArkCreateSnapshots

      Comment


        #4
        This is what happens after an incremental backup:

        Code:
        At subvol /media/sarah/Snapshots/Sarah Backups/Sarah 02-07-2019 15:18:32
        At snapshot Sarah 02-07-2019 15:18:32
        ERROR: unlink sarah/.local/share/Trash/files/Children of Mana Music - Beyond the Blue Sky.webm failed: No such file or directory
        Something goes screwy with the unlinks. I don't change anything, this just always happens, even with fresh backups. This seems crazy to me since this happens on all of my drives, so its not a HDD issue. I kind of need to resolve this since I can't just keep writing new backups all the time.

        What should I do, and if I can't resolve it here, do you know of a better place to ask?

        Comment


          #5
          The issue is in your script, not btrfs. Maybe it has to do with all the spaces you use in your file names. That's exactly the error you'd get - "...No such file...".

          I honestly don't know what "unlink" is supposed to do. I'm guessing you have hard links you don't want followed by the backup

          Please Read Me

          Comment


            #6
            This leads to several paradoxes then:

            1) Why does it work at all?
            2) Why does it work well until I restart the computer, then I get unlink issues when I try and sync a fresh snapshot to the disk?
            3) Why does it only seem to have broken recently?

            Maybe I should just go with a better snapshot provider then.

            I'm guessing that snapshots are done by programs and not by hand all the time? What program would you recommend for automating snapshotting/backups?

            Comment


              #7
              Originally posted by PhysicistSarah View Post
              This is what happens after an incremental backup:

              Code:
              At subvol /media/sarah/Snapshots/Sarah Backups/Sarah 02-07-2019 15:18:32
              At snapshot Sarah 02-07-2019 15:18:32
              ERROR: unlink sarah/.local/share/Trash/files/Children of Mana Music - Beyond the Blue Sky.webm failed: No such file or directory
              Something goes screwy with the unlinks. I don't change anything, this just always happens, even with fresh backups. This seems crazy to me since this happens on all of my drives, so its not a HDD issue. I kind of need to resolve this since I can't just keep writing new backups all the time.

              What should I do, and if I can't resolve it here, do you know of a better place to ask?
              Why are you including your Trash folder in your incremental backups? Seems to me, that the problem you are seeing is due to the fact that the Trash folder was intact when the Backup was made, but when you executed the incremental backup, the Trash folder had already been deleted.
              Windows no longer obstructs my view.
              Using Kubuntu Linux since March 23, 2007.
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment


                #8
                I just backup the entire @ and @home directories.

                Is there some way to exclude the trash folder?

                I don't recall emptying the trash during the backup, but maybe it's that the trash can't be emptied period?

                How would I get around that?

                I'm not sure how BTRFS backups are typically done automatically.

                I looked into Snapper, but for whatever reason it doesn't work on my system: https://askubuntu.com/questions/1156...-fresh-install

                If I can't use my backup script (Or I'll have to make modifications to it), I'll have to get something more robust like a GUI program to do it.

                How would you recommend that I get around the trash issue, and how do you typically back up your drives?

                Comment


                  #9
                  BTRFS backups, or any other type of backup AFAIK, aren't done "automatically" so you must mean something other than what I'm reading.

                  I also backup the entire @ and @home, and 12 other subvolumes on my server, incrementally, and using a script, and I've never seen or heard of any error like you're getting. At least some, if not all, of these subvolumes contain trash folders. In fact, I'd wager dollars-for-doughnuts that whatever you're encountering has nothing to do with BTRFS.

                  It's your script. I suggest you start there with some basic de-bugging techniques and tracing.

                  I suppose it is possible that there's a larger error you're encountering regarding the "unlink" error, but I've never encountered it in the 20 plus years I've been using Linux so I got no info there.

                  Please Read Me

                  Comment


                    #10
                    @Snowhog: A BTRFS snapshot/backup is an entire copy of the filesystem which would include the Trash folder. Files in "Trash" aren't actually deleted until you "Empty...". As I've stated ad nauseum, I've never had a send|receive operation fail with the "unlink" error and I've literally done that 100s if not 1000s of times.

                    Please Read Me

                    Comment

                    Working...
                    X