I have some scripts that I would like to automatica开发者_StackOverflow中文版lly update when there is a newer version available (using a cronjob to do the regular checks and download from ftp?). Is there a way (not too complicated/advanced) to achieve that? thanks in advance
Use svn or git instead of ftp.
To set svn up, go to a svn repository (ie. assembla or github) and read the instructions. You can upload your code then, starting an svn or git repository. each time you update your code you can just write (for svn):
svn commit /path/where/you/code
You have to do a first checkout afterwards:
svn checkout http:/repositoryurl /path/to/the/code
That way you can get your cron job with a single line, ie. for svn:
svn update /path/to/the/code
If the scripts are not yours, it is worth checking for an available svn or git repository, as most projects use something like that.
精彩评论