In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "how to implement the Shell script that regularly submits code to the SVN server under Ubuntu". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to implement the Shell script that regularly submits code to the SVN server under Ubuntu.
There are two uses, one is to be lazy not to submit code, and the other is to use it on a remote server for regular backups.
The code is as follows:
Sudo gedit / etc/crontab
Open it and join the line.
The code is as follows:
0 * my_user_name my_script_path
Indicates that each hour executes my_script_path as my_user_name. It is best to use the current user name and modify the default root, otherwise the submission may fail as root. For more information, please ask the usage of Baidu crontab.
Then the content of the script is:
The code is as follows:
#! / bin/bash
Cd $my_code_path
# add all new files
Svn st | grep "?\ +" | sed "sUnip?\ + / /" | xargs svn add
# Delete all missing files locally
Svn st | grep "!\ +" | sed "splash!\ + / /" | xargs svn delete
# submit
Svn ci-m 'auto commit by script'
You can also copy or softly link the script to / etc/crontab without modifying / etc/cron.hourly/, and use su to switch users in the script, and change it to:
The code is as follows:
#! / bin/bash
Su-your_user_name
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un