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

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,962