I have a website in CentOS which uses SVN to update and commit.
I want to write a shell script by crontab to auto run schedule work.
I have test a SVN command, svn status | grep ^?
It shows me results like below:
M index.php<br/>
M data/config.php<br/>
? date/aaa.php<br/>
? images/bbb.php<br/>
? images/product1.jpg<br/>
? images/product2.jpg<br/>
? themes/ccc.php<br/>
? themes/index.html<br/>
? temp/compiled/index.php<br/>
? temp/compiled/article.php<br/>
? temp/compiled/footer.php<br/>
I write a SVN command which can delete all unversion and modify php file, like below:
svn status --no-ignore | grep ".php$" | sed 's/^? //' | xargs rm -rf
I want to write a shell script that can help me:
- delete the unversion file, except modify file
- only delete php file
- excepte file ine temp folder
please help me, thanks all