You need to sign in to do that
Don't have an account?

backup visualforce code
I am looking for a method to backup the code for a visualforce page and controller. If it could do it once a day that would be ok. If it did it on a button click that would be great also. Is there anything out there that can do that, or is there a way I can write an apex code to do it?
You can make it one click by doing the following:
1) Install Linux on a server somewhere.
2) Install Java on the server.
3) Install ant on the server.
4) Place the Salesforce Ant toolkit on the server.
5) Install the svn client on the server (most Linux has one available by default).
6) Configure an Ant directory with the required items (build.xml, build.properties, package.xml).
7) Configure the SVN folder to sync with.
8) Write a Shell Script that runs a retrieve metadata, followed by a svn commit.
9) Write a crontab file that runs every night.
There. You now have a fully backed up SVN solution.
You could also do this other ways, such as a Windows Batch file. You could also store the files as ZIP files instead of on an SVN, but that limits your ability to compare versions.
All Answers
You should be able to do this with the Force.com Migration Tool. See below.
http://wiki.developerforce.com/page/Migration_Tool_Guide
you may use Eclipse tool and create a new project eevryday
use ant tool
use SVN like tortoise svn and sync your eclipse repository to svn
but none of the method is one click.
You can make it one click by doing the following:
1) Install Linux on a server somewhere.
2) Install Java on the server.
3) Install ant on the server.
4) Place the Salesforce Ant toolkit on the server.
5) Install the svn client on the server (most Linux has one available by default).
6) Configure an Ant directory with the required items (build.xml, build.properties, package.xml).
7) Configure the SVN folder to sync with.
8) Write a Shell Script that runs a retrieve metadata, followed by a svn commit.
9) Write a crontab file that runs every night.
There. You now have a fully backed up SVN solution.
You could also do this other ways, such as a Windows Batch file. You could also store the files as ZIP files instead of on an SVN, but that limits your ability to compare versions.
https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B3XxLEAV
I don't know if I can trust my code to an app that promises that I will never "loose" my code. But, it's an interesting app.