I am looking for a solution which allows me to access any file of my productive environment in my local virtual machine for testing. Both systems are running Ubuntu 10.04 lts.
The current solution is a combination of cron and rsync. This means that we have to transfer periodically every productive file to the testing environment. The disadvantage is that it takes time to transfer these files and costs a lot of hard disk capacity. I should also add that most of the live files are not needed during testing but there is no clear pattern to exclude files.
Another solution is a ssh mount like sshfs. But this would not allow us to create files on the local testing machine without changing files of the live system.
Is there any solution similar to a ssh mount which allows me to pull files from the live system on demand without pushing changes back to the live system?
The solution of cjc / Zerodache is exactly what I needed:
apt-get install sshfs apt-get install unionfs-fuse cd /root/ mkdir local_delta mkdir live_system mkdir test_system sshfs email@example.com:/www/ /root/live_system unionfs-fuse -o cow /root/local_delta=RW:/root/live_system=RO /root/test_system
/root/test_system shows all files of the live site.
Files created within the
test_system folder are only created in the
local_delta but not on the server. Also file modifications and deletions are only written to the first branch
local_delta as the second branch
live_system is set to RO (read only) and the
-o cow option is set.