Posts

Showing posts from August, 2013

SVN tips in Linux: create root repository, system-delete, conflict and partial checkout

1. create the  folder in the repository: (1) Create root repository. svn mkdir svn+ssh://username@hostname/projectname/trunk -m "Create the trunk folder" Then the first version can be checked out. (2) Create sub-folder in the root repository svn mkdir svn+ssh://username@hostname/projectname/trunk/test -m "Create the test folder" And this new folder needs to be checked out. Even you already created a folder using the same name in the local copy. Your local folder and files will not be overwritten.  And then you can commit your local files in the new folder into the repository. 2. Delete the svn local copy As the .svn folder in the checkout is an hide recursive folders, when you directly remove the folder, you will get the "protected file " warning and it is not easy to delete all the files in the folder. Below is the way to completely delete the folder. $cd file/with/.svn $find -name .svn -exec rm -r -f {} +  /* delete the recursive folders in t

bash shell date usage (normal in bash and for bash parameter)

date function in bash shell script is really powerful. Notice:  1. no space after the "+" to define the format. 2. If use on a bash cron job cmd, then "\" is need to escape %. It recognize the datetime in many different format and can be convert to almost any format you need. 1. change YYYYMMDD to YYYY-MM-DD olddate="20121010" newdate=$(date -d"${olddate}" +%Y-%m-%d) 2. want to get the date n days before a fixed date olddate="20121010" days=n newdate=$(date -d"${olddate} -  ${days}  days" +%Y-%m-%d) 3. want to get the date n days after a fixed date olddate="20121010" days=n newdate=$(date -d"${olddate} +  ${days}  days" +%Y-%m-%d) 4. n month before newmonth=`date +%Y%m -d  "$n months ago"` 5. Use as the bash parameters Be aware that the "%" needs to be escaped ~$bash example.sh  `date +\%Y-\%m-\%d -d "3 days ago"` or ~$bash example.sh  $(date +\%Y-\%m-