rudzik8

monkey backup

...or how I keep my files

this isn't a particularly complicated system. in fact, it is stupid simple; hence "monkey". because of that, it can easily be automated if you really want that.

I've "designed" it when moving some folders from "home"s from Windows to Linux and vice-versa. but it can be useful when moving to a different hardware too, or when just reinstalling the thing.

this guide is fairly descriptive, just so you can share that with your not-so-tech-savvy friends or family members. enjoy :D

three issues to solve first

  1. there should be something to store your backup. sure, you could use an online service like Google Drive, but if you are storing your passwords or keys inside of the backups in question, I would say this isn't a great idea. personally, I use a 120 gigs portable solid-state drive (or SSD), which is more than enough.

  2. there should be something to backup. usually, that's not an issue at all: again, you could store your passwords and keys; maybe some code, pictures, videos; you could basically keep an archive of your whole (internet or not) life!.. personally, I usually backup my Documents, Pictures, Videos and folders alike, which includes my Minetest worlds too. no need to backup your downloads or temp files (unless there's something really important in here, then just move it to Documents).

  3. there should be something to compress your backup. while storing all your backups uncompressed is possible, it is extremely pricey in terms of space usage. both Windows and most of the Linux distributions provide built-in compressing tools, but built-in zip-compression on Windows isn't great (download 7-zip and use it instead), and Linux distributions sometimes vary a lot in the packages they provide out of the box. I'm sure the one I'll be using here is built into every distro, but just for a good measure:

    • Debian, Ubuntu, Mint (apt):
      sudo apt install tar gzip
    • RHEL, Fedora (dnf):
      sudo dnf install tar gzip
    • Arch (pacman):
      sudo pacman -S tar gzip
    • openSUSE (zypper):
      zypper install tar gzip

producing the monkey backup

for Windows, I'm providing a step-by-step guide that uses GUI. for Linux, I'm providing a step-by-step guide that uses commands. this way I hope to help the most people from both sides <3

Windows

  1. open up an Explorer window
  2. go to Drive C:\Users*your-username-here*\ (that's the home folder)
  3. [Ctrl]+[Left Click] the folders you want to backup here
  4. [Right Click], hover on 7-Zip and choose Add to archive...
    • a window should pop up
  5. for better compression, change Archive Format from zip to 7z
  6. in the Encryption frame, enter a password (don't forget to follow general password advice)
  7. click OK
  8. wait
  9. when it's done, search for a file named your-username-here.7z
  10. open it (double [Left Click]) to ensure all the folders you wanted to backup are here

Linux

  1. launch a terminal window (either press [Ctrl]+[Alt]+[T] or use one of these guides)
    • as a good measure, do pwd (print working directory) to ensure you are in your home folder. if not, cd ~
  2. do ls -A. there probably are a lot of directories in here: generally I backup Documents, Pictures, Videos and the Firefox profile (.mozilla/)
  3. compress them:
    • tar czfv home.tar.gz and then list the directories, separated by space; e.g. tar czfv home.tar.gz Documents/ Pictures/ Videos/ .mozilla/
  4. after that's done, to ensure all the folders you wanted to backup are here do vim home.tar.gz
    • you can select the directories inside using arrow keys or your mouse, and enter them by pressing [Enter]
  5. when you're done, exit by typing in :q. after all, that's still vim ;D

storing the monkey backup

this pretty much depends on how you solved issue 1. upload or copy&paste in the file you've produced during the previous section. the other question is: for how long do you store it?

if you don't care about space really, surely you can keep all the backups you want, but do you really need to store a copy of your files from 5 years ago?

you may, but me personally doesn't. that's why I recommend removing older backups. or at least only keep one for each year, just so you can look back and admire your progress.

restoring the monkey backup

that depends on if you switch systems or not. if it is a move from Windows to Windows, or from Linux to Linux, or from Windows to Linux, or from Linux to Windows... well, all these variants require different steps.

Windows → Windows (GUI)

  1. download 7-Zip
  2. download or copy&paste the monkey backup you've produced in
  3. double-[Left Click] on it
    • now, let's set the other part ready
  4. open up an Explorer window
  5. go to Drive C:\Users*your-username-here*\
    • both parts ready
  6. select the 7-Zip window, then select the contents inside of it using mouse
  7. drag&drop them onto the Explorer window you've opened earlier
  8. enter the password you've set when producing the backup
  9. wait
  10. when it's done, check the folders affected. if everything's right, they should have the files you need.

Linux → Linux (Terminal)

  1. launch a terminal window
  2. locate your backup. for this guide, I'll suppose it is ~/Downloads/home.tar.gz
  3. tar xzfv and then include your file path; e.g. tar xzfv ~/Downloads/home.tar.gz
  4. after it's done, check that the files are here: ls & cd the affected directories

Windows → Linux (Terminal)

  1. launch a terminal window

  2. install p7zip:

    • Debian, Ubuntu, Mint (apt):
      sudo apt install p7zip-full
    • RHEL, Fedora (dnf):
      sudo dnf install p7zip
  3. locate your backup. for this guide, I'll suppose it is ~/User.7z

    • IMPORTANT: it should be in the home directory's root! if it isn't (e.g. ~/Downloads/User.7z), then move it:
      mv ~/Downloads/User.7z ~/User.7z
  4. 7z x and then include your file path; e.g. 7z x ~/User.7z

  5. wait

  6. after it's done, check that the files are here: ls & cd the affected directories

Linux → Windows (GUI)

  1. download 7-Zip
  2. download or copy&paste the monkey backup you've produced in
  3. double-[Left Click] on it
  4. double-[Left Click] the .tar file inside of it
    • now, let's set the other part ready
  5. open up an Explorer window
  6. go to Drive C:\Users*your-username-here*\
    • both parts ready
  7. select the 7-Zip window, then select the contents inside of it using mouse
  8. drag&drop them onto the Explorer window you've opened earlier
  9. enter the password you've set when producing the backup
  10. wait
  11. when it's done, check the folders affected. if everything's right, they should have the files you need.

conclusion

that's it! again, I really hope this guide helped you in one way or another. it is in no way perfect, but I've been working on it for the past couple of days, and even produced a monkey backup and restored it in the process.

if you have anything to correct here, or if you experience issues with following this guide, feel free to contact me!

#tech