I have a nightly svn commit script that should take into account all possible scenarios and commit new things to our svn repository. Basically I am running the following steps:
- svn status [path] to add any new files
- svn status [path] to delete any manually removed files
- dumping mysql development database
- svn commit all the above changes with a default message.
Here is the script that we are using:
#!/bin/bash
echo "Adding new files to the nightly commit"
svn status [path] | grep ? | sed 's/[?MD]//g' | xargs -I {} svn add {}
echo "Removing files manually deleted"
svn status [path] | grep ! | sed 's/[!]//g' | xargs -I {} svn del {}
echo "Dumping our development database"
mysqldump --add-drop-database --add-locks --create-options --disable-keys --extended-insert --result-file=/repopath/database.sql databasename
svn commit /repopath/ -m "Nightly Automatic commit of changes"
I just want to make sure that the ? and ! are taken care, and that I don't have any other scenarios that I have not think of. Any help will or improvement to this script will be very helpful. Feel free to use this script as you please for any of your SysAdmin tasks.