The above suggestion is the right idea I think. I would do it slightly differently though. I'd add the following to ~/.bashrc
Code:
getdir() { rsync -av "/path/to/usb/$1" .; }
putdir() { rsync -av . "/path/to/usb/$1"; }
checkdir() { rsync -avn . "/path/to/usb/$1"; }
(Then type "source ~/.bashrc")
If you change /path/to/usb to be the location of your USB drive, this essentially gives you a very primitive version control system. From the commandline, you might do something like:
Code:
cd ~/Projects
getdir project1 # Bring over a directory
cd project1
... Edit some files ...
checkdir project1
... check if the changes look right ...
putdir project1 # Put it back on USB
Edit:
I forgot the requirement to delete. In which case, change putdir to be:
Code:
putdir() { rsync -av . "/home/sdennie/tmp/$1" && rm -rf `pwd` && cd ..; }
That will erase the directory you are in but only if the rsync is successful.
Edit 2:
Changed the usage to add a "cd project1" as that is the real usage case.
Edit 3: Add a "cd .." to putdir to drop back a directory level. Final edit. I promise.
Bookmarks