Monday, March 26, 2012

Merging Folders in Linux For backup Purposes

Hi guys,

So, I am in serious need to completely destroy my current linux OS :(, but fooooo, I've loads of files that I need. What i did in the past was to set up a server at home and synchronize my files there. The folder where my backup are kept are always ordered in sub directories.

for e.g. in the back, u have the following folders:

  1. Books 
  2. Videos
  3. Programs
When you will synchronize from your newly OS with that file from the server, the content of your files will be in the same style as the server and will also contain all the files. Now, on your new linux, make sure that you are well organized so that the next time, you can push these changes to your server and have a up-to-date copy of your backup. Always try to categorize files well, else u'll suffer ;)

so, lets say we have a file backup on the server, and you want to have the content of backup from the server on your files, so simply use scp

scp -rv /home/<username>/file <username>@<host>:/home/<username>/backup

Now you'll have the files on your new linux

Now, lets say that in the future, you have to merge the files on your linux with that of the server to get an updated one, simply use rsync

rsync -avPr /home/<username>/file/  <username>@<host>:/home/<username>/backup

hey, I'm newbie so if ever there are errors, then do inform me, thanks!!

No comments:

Post a Comment