I have ubuntu 12.04 installed in my internal HDD. Is it possible to carry my desktop in my pendrive and use in my office computer and synchronize with my computer when I am back at home.
1 Answers
I do something similar, and just use rsync to keep the pendrive up to date or to update one of the computers. rsync works best because with the right switches it will back everything up without overwriting the same file each time, or overwriting newer files with an older version.
To backup (for example) your Documents directory to the Pendrive first give the pendrive a label (volume name) and make a target directory such as 'Documents' on it. By giving the pendrive a label it will be easily found under the /media directory. Next issue the following command:
rsync -av ~/Documents/ /media/yourlabelname/Documents/
This command will backup up everything in your home Documents onto the pendrive. To reverse the process and update the files on another comptuer, simply reverse the rsync command eg:
rsync -av /media/yourlabelname/Documnets/ ~/Documents/
It's easy enough to put both of these commands into very short bash scripts and execute one each time by typing the name of the bash script. If the scripts are in ~/bin then they will get included in the executable path.
Note that if the USB drive is formatted FAT then the volume name is normally limited to capitals only, even if you typed the volume name in lowercase when you created it. Because bash is completely case sensitive you must get the volume name and directory name exactly right or the rsync commands will fail to work.
- 8,471
- 1
- 37
- 39