You are not logged in.

#1 2015-07-21 19:59:02

tech4david
Member
From: UK
Registered: 2015-05-24
Posts: 17

bacpac: Backup script for pacman config and packages

I once created my own backup script that backs up my manually-installed packages to a secret Gist, as this way I can easily restore to another computer and I don't have to back up to my own memory stick or hard drive. In my opinion saving stuff online is much easier than to external hard drives and memory sticks etc. as you don't have to worry about losing them or dding over them with a distro ISO (that's basically all I use my usb stick for anyway big_smile).

It's the holiday right now for me and today I decided to make a version of this for anyone to use. It's much more advanced than the original version I was using; the original one was designed only for me so it didn't need to have as many features. For example, it could only back up packages and had no way to restore them.

I've put the new version on GitHub and you can find it here. Setting it up is pretty simple -- you just have to create a Gist* with any random content, then paste in the URL into bacpac and it'll do all the hard work for you. I hope that some of you find this helpful! Btw, I'm aware there are a couple of existing pacman backup programs but I don't think any of them are as simple as this to set-up.

*You can use any other Git server but Gist is probably the easiest to set-up for most users and it's also free.

Features

  • Back up manually-installed packages, /etc/pacman.conf and /etc/pacman.d/mirrorlist

  • Update the script automatically at any time

  • Don't need to manually use git if you don't want to; the script does everything for you

Not features

  • Automatically restore AUR packages (probably won't be implemented because people may want to modify PKGBUILDs first or change build options etc.)

Bugs

Please try it out and report any issues here on the forum or on GitHub! Enjoy smile

TL;DR get it here!

Last edited by tech4david (2015-08-01 20:02:05)


GitHub: tech4david // Twitter: @tech4david // Email: ʇǝu˙xnuıןɥɔɹɐ@ʎǝןıɐq˙pıʌɐp // GPG: 0E4A 8642 3E38 0B5D D98B 3413 FE28 D356 A90A 8B49

Primary OS: OS X // Favorite DE: MATE // Favourite editors: Atom+Vim // Favourite browsers: Safari+Chrome // Favourite programming language: Ruby

Offline

#2 2015-07-24 13:54:13

benoliver999
Member
From: Sheffield
Registered: 2014-02-01
Posts: 34
Website

Re: bacpac: Backup script for pacman config and packages

I like this but I must confess, giving up my github password makes me nervous...!

Offline

#3 2015-07-24 13:58:35

tech4david
Member
From: UK
Registered: 2015-05-24
Posts: 17

Re: bacpac: Backup script for pacman config and packages

benoliver999 wrote:

I like this but I must confess, giving up my github password makes me nervous...!

You're only giving your GitHub password to git itself – the bacpac script doesn't actually read it at all. You can check the source code if you don't believe me wink


GitHub: tech4david // Twitter: @tech4david // Email: ʇǝu˙xnuıןɥɔɹɐ@ʎǝןıɐq˙pıʌɐp // GPG: 0E4A 8642 3E38 0B5D D98B 3413 FE28 D356 A90A 8B49

Primary OS: OS X // Favorite DE: MATE // Favourite editors: Atom+Vim // Favourite browsers: Safari+Chrome // Favourite programming language: Ruby

Offline

#4 2015-08-01 13:18:33

bartuka
Member
Registered: 2015-05-25
Posts: 28

Re: bacpac: Backup script for pacman config and packages

Hello tech4david, I liked your idea and I have actually used already. Let me ask you more information about your script here.  I did a online upload to my github account of 3 fles:   package.list, mirrorlist and pacman.conf. Right?

And now when I re-install my system again I can use ./bacpac restore and the script will make the dowload of all the packages on the packages.list for me. That's correct? 


Thank you.
Nice work though.


Specs: Macbook Pro Mid 2012 + 16GB RAM + 256GB SSD + 512GB HDD
Windows Manager: i3wm
File Manager: Ranger
Web Browser: qutebrowser

Offline

#5 2015-08-01 19:42:34

tech4david
Member
From: UK
Registered: 2015-05-24
Posts: 17

Re: bacpac: Backup script for pacman config and packages

bartuka wrote:

Hello tech4david, I liked your idea and I have actually used already. Let me ask you more information about your script here.  I did a online upload to my github account of 3 fles:   package.list, mirrorlist and pacman.conf. Right?

And now when I re-install my system again I can use ./bacpac restore and the script will make the dowload of all the packages on the packages.list for me. That's correct? 


Thank you.
Nice work though.

Yep, you just have to clone the repository from Gist (or wherever you pushed it to if not Gist) and then, as you said, `./bacpac restore`. You'll need to at least have the bacpac dependencies installed before restoring or it might not work. Remember to `./bacpac update` occasionally to keep it up to date.

Important: check here for current bugs, as these may affect you. However you should be ok if you don't use custom repositories; the other 2 bugs are less likely to occur usually.

-- David

Last edited by tech4david (2015-08-01 19:56:43)


GitHub: tech4david // Twitter: @tech4david // Email: ʇǝu˙xnuıןɥɔɹɐ@ʎǝןıɐq˙pıʌɐp // GPG: 0E4A 8642 3E38 0B5D D98B 3413 FE28 D356 A90A 8B49

Primary OS: OS X // Favorite DE: MATE // Favourite editors: Atom+Vim // Favourite browsers: Safari+Chrome // Favourite programming language: Ruby

Offline

#6 2015-10-21 19:09:14

eNTi
Member
Registered: 2006-04-30
Posts: 109

Re: bacpac: Backup script for pacman config and packages

hi.

i've installed bacpac via pacman... and well... i have no clue how to use it? i'v tried to:

root@eNTi $ bacpac init
processing init... (0 remaining in queue)
error: failed to find init

what gives?

Offline

#7 2015-10-21 19:40:54

tech4david
Member
From: UK
Registered: 2015-05-24
Posts: 17

Re: bacpac: Backup script for pacman config and packages

eNTi wrote:

hi.

i've installed bacpac via pacman... and well... i have no clue how to use it? i'v tried to:

root@eNTi $ bacpac init
processing init... (0 remaining in queue)
error: failed to find init

what gives?

Hi, the bacpac you have installed is a different project with the same name. To install this, run the following in a terminal:

cd <some directory>
git clone https://github.com/tech4david/bacpac
cd bacpac
./bacpac init

BTW, you'll need a GitHub account (or a git server you have access to) for the setup process.

I chose not to use an AUR package because it would take more effort to restore packages on a new system -- with this approach, you simply need to clone your personal repository and run a command to restore your packages.


GitHub: tech4david // Twitter: @tech4david // Email: ʇǝu˙xnuıןɥɔɹɐ@ʎǝןıɐq˙pıʌɐp // GPG: 0E4A 8642 3E38 0B5D D98B 3413 FE28 D356 A90A 8B49

Primary OS: OS X // Favorite DE: MATE // Favourite editors: Atom+Vim // Favourite browsers: Safari+Chrome // Favourite programming language: Ruby

Offline

#8 2015-10-22 07:16:01

eNTi
Member
Registered: 2006-04-30
Posts: 109

Re: bacpac: Backup script for pacman config and packages

oh... thank you for the explanation. this situation is extremely confusing tbh. smile

Offline

Board footer

Powered by FluxBB