0

I am looking to have three web folders one would serve as a backup and rollback and one for testing new releases.

/var/web/project
/var/web/project_test
/var/web/project_backup

Say I upload my code to project_test and I'm happy with it. I'm now ready to release it. How would I then have a singular command that would..

1) Move 'project' into 'project_backup'.  
2) Move 'project_test' into 'project' 
3) Delete whats in backup
Robbo_UK
  • 55
  • 1
  • 5
  • You may want to expand on what you mean ( and why you say) singular command as it will frame the sort of answers you will receive. What have you tried so far? – Drew Khoury Oct 07 '13 at 09:18
  • I would personally upload a folder for each version having them accessible through some sort of rewrite. Production could be managed by a symlink you point to whichever version you like. – Drew Khoury Oct 07 '13 at 09:23

1 Answers1

2

You can always write a bash script:

#!/usr/bin/bash
rm /var/web/project_backup
mv /var/web/project /var/web/project_backup
mv /var/web/project_test /var/web/project
mkdir /var/web/project_test

Another way, if you're using a CVS (eg git) is using different branches for different stages, and commiting/fetching from/to a branch you need.

mulaz
  • 10,472
  • 1
  • 30
  • 37