Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BU Backup on Manjaro?
#1
Hey guys, I'm about 9 months into my switch to Linux and it has all been on Debian (PureOS).  I've been using BU for a while now and was going to use it to move my home folder to a Manjaro install.  I know I can just use rsync directly but I really like the ease of using BU.  I looked at the script and correct me if I'm wrong, but the only thing "Debian" is where it checks to see if rsync and less are installed, and if not, it installs them.  I don't know a lot about scripting, but can I just either delete those lines or change them to do things the Manjaro (pacman I guess) way?

Thanks

John
Reply
#2
Hello,
I am not sure about BU but I use the old XBT and there are the same except Joe removed the "output" text as it was backing up from XBT and called it BU... I have not used it and I just looked at BU script and it looks like XBT mostly to me... :-)

BEFORE YOU do anything make a BACKUP of the file you are going to change!!!!! ALWAYS and I mean ALWAYS work off of a backup of the file...

I have modified my copy of Joe's XBT Backup script heavy for my needs but I have it setup to work on 99% of the Arch Distro's I have tried it on and it works well..
Here is the first part of the script for Arch systems that will have to be changed, I assume you know how to edit Text files ...
Code:
# Here we update the packages and Repo Information: 07/03/19 -Bruce
sudo pacman -Syu

# Check for rsync, less and parted, install if needed:
# I changed the package manager commands to work with Manjaro Arch: 07/03/19 -Bruce

pacman -Qs | grep -qw less || sudo pacman -S -yyq less
pacman -Qs | grep -qw parted || sudo pacman -S -yyq parted
pacman -Qs | grep -qw rsync || sudo pacman -S -yyq rsync

An here is the Debion part that needs to be replaced...

Code:
Check for less and rsync, install if needed:

dpkg -l | grep -qw rsync || sudo apt install rsync -yyq
dpkg -l | grep -qw less || sudo apt install less -yyq

BTW your mileage may vary so make these changes at your own risk, but they do work for me!

Also you will have to change all the paths in the script because it is setup for Debian system paths..

Here is the Debian way... Pay close attention to the PATH /media/$user statement.....

Code:
# Run rsync command:

echo "Backing up /etc and /home to BU_Drive/BU_Backups/$host/..."
sudo rsync -aH --delete --info=progress2 /etc /home \
/media/$user/BU_Drive/BU_Backups/$host/

An here is the Arch way of setting the Paths...

Code:
# Starting synchronization:

clear
echo $'\n'$"XBT Backup"
echo $'\n'$"Backing up /etc..."
sudo rsync -aHv --delete --progress /etc/ \
/run/media/$user/XBT_Drive/XBT_Backups/$host/Etc_Backup/ 2>> /tmp/backup.log

Basically you go through the whole script and take "/run/media/" and put it in place of just "/media"  in all the lines that has the "/media Path"...

This one is a must... If not set right the USB drive will not be seen at all...

Code:
# XBT backup. Runs full backup of /etc and /home directories on host machine.

# Checking for valid media:

if [ ! -d /run/media/$user/XBT_Drive ]; then

   clear
   echo $'\n'$"XBT Backup"
   echo "XBT Error: NO XBT DRIVE FOUND! Please make sure XBT_Drive USB is connected."
    echo "If you just set up the XBT Drive, remove it and plug it back in."
   greeting
The "/media/$user/BU_Drive" MUST be changed to "/run/media/$user/BU_Drive" or nothing will work from the get go!!!
It is confusing at first to read all the lines but just take your time and search for "/media" and add "/run" in front of it. (Minus the " " on the ends..)

Like I said I have not looked at all of the code for BU but I am sure about the paths on both OS's... Good luck!
LLAP
**********************************************************
Taglines of the BBS Days:
Today is the tomorrow you worried about yesterday. 
  Everybody remember where we parked. - Kirk
    Not everything in life is a 1 or a 0.
       Experience enables you to recognise a mistake when you make it again...
Reply
#3
Wow, that is way more than I hoped for when it comes to an answer!!! Thank you VERY much!!! Being brand new to Manjaro and knowing nothing yet (it's only been 24 hours), your reply is a huge help. I'm doing all of this on an old laptop that isn't my daily driver so I feel good about modifying the script and letting it do it's thing.
Reply
#4
(01-11-2020, 02:51 AM)TooManyHobbies Wrote: Wow, that is way more than I hoped for when it comes to an answer!!!  Thank you VERY much!!! Being brand new to Manjaro and knowing nothing yet (it's only been 24 hours), your reply is a huge help.  I'm doing all of this on an old laptop that isn't my daily driver so I feel good about modifying the script and letting it do it's thing.

Your welcome! I hope that you could follow what I posted as I don't know your computer skills...Lol
Most of it was trial and error for me at first and I still screw stuff up at times. I reinstalled Mint 3 times in as many days just poking around and breaking stuff.... :-)

Like I said BU is the old XBT with a few lines removed but for the most part the same... I just made the command changes that Arch / Manjaro uses and it worked... I will admit I have not tired the "Recovery Part / Restore part of the program to much in it native form just once and it worked... I have not used the Restore on Arch / Manjaro, have not needed too... The back-up works as it should so the restore should too..

You are doing it the correct way, using another computer to learn on. That is the way I did it and one day I just deleted Windows and the rest is a fun and interesting learning trip... }:-)

Just so you know, sometimes there are more that one way to do something in Linux so don't get confused if you read something and it says the same thing but a in another way and they both work... Lol

Never be afraid to ask questions here, there is a wonderful bunch of folks here that are willing to always help!
Take care and enjoy you Linux journey....
LLAP
**********************************************************
Taglines of the BBS Days:
Today is the tomorrow you worried about yesterday. 
  Everybody remember where we parked. - Kirk
    Not everything in life is a 1 or a 0.
       Experience enables you to recognise a mistake when you make it again...
Reply
#5
If someone doesn't mind old hardware, they can have lot's of computers to play with. My newest machine was purchased in 2011. Since you yous BU I wonder if you've seen an issue with permissions when using the same drive for different users. I got my wife running Mint and I have a Debian machine. I have to manually change the permissions on the folder each computer uses, even though the permissions on the drive are handled by the script. I'm sure I can figure it out, but figured I'd ask.

I'm enjoying Linux because of the control the user has. I was able to fix a problem with my trackpad because I could see the code, find a fix and recompile. Back in the 90's I was a programmer, but I never really had to understand the environment, how to set up a compiler or use version control software. Now I'm setting all of that stuff up myself and the learning curve is STEEP! Learn APT or pacman, git, how to compile Kernel modules and install them etc. The there is the Arch / Manjaro tool chain, the Debian tool chain, the Red Hat tool chain etc. I will say the the Manjaro team makes it really easy to compile and use your own kernel. The Arch documentation is a great resource too. Anyway, thanks again.
Reply
#6
(01-14-2020, 02:58 PM)TooManyHobbies Wrote: If someone doesn't mind old hardware, they can have lot's of computers to play with.  My newest machine was purchased in 2011.  Since you yous BU I wonder if you've seen an issue with permissions when using the same drive for different users.  I got my wife running Mint and I have a Debian machine.  I have to manually change the permissions on the folder each computer uses, even though the permissions on the drive are handled by the script.  I'm sure I can figure it out, but figured I'd ask.
 I am not sure what you want here... If you are talking BU for other Distros, BU will work with any Ubuntu based Distro as is... If you want to us it like on Arch etc, you will have to modify the script code to work with the Distro...
I am the only one on my systems so I really can't help you there with that issue.
As a rural you should not have to change anything as the permissions are set when the user is logged into the system. Other than that I really not sure... Maybe someone else can help with that...  Dodgy  

Quote:Now I'm setting all of that stuff up myself and the learning curve is STEEP! Learn APT or pacman, git, how to compile Kernel modules and install them etc. The there is the Arch / Manjaro tool chain, the Debian tool chain, the Red Hat tool chain etc. I will say the the Manjaro team makes it really easy to compile and use your own kernel. The Arch documentation is a great resource too. Anyway, thanks again.

Yes Linux has a Learning curve but it is worth the time! I have stuck with Debian Distros until the last 4 month and have moved out to the Arch Distros and I see uses for them all... Good luck in your travels with Linux!  Big Grin
LLAP
Reply
#7
Okay, thanks. I'll dig in and figure out what's going on.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)