备份cvs服务器的python脚步!

LinuX下 CVS 安装部署备份恢复等 LinuX下 CVS 安装部署备份恢复等, 自己一条一条整理出来的, 肯定能够帮到你哦! 立即下载

公司的所有后台代码都保存在cvs服务器上,以前备份都是手工在做,不能做到及时备份.

最近天气冷了,空调等用电大户开始启动,办公室已经跳闸好几次了.一台VSS服务器的cpu就光荣牺牲了.

幸亏不是烧的硬盘,万幸之余又些后怕.要是cvs服务器坏了,那就不得了.赶快写个自动备份的脚步.

本来是准备用cvsup做的,安装配置还比较麻烦,干脆就用最简单的方式了.先压缩,后ftp进行备份.

 脚步如下:

[code]

#!/bin/env Python
import os,time,ftplib,string
import glob,sys
import os.path

home='/root/backcvs'                    #本地保存文件目录
ftphost='192.168.0.99'                  #ftp备份服务器
ftpuser='cvsroot'   #ftp登陆用户名
ftppass='xxxxxxx'   #ftp登陆密码
ftppassmode=1    #ftp模式 port 0 passive 1
ftpdir='backcvs'   #ftp上存放备份的目录

cvsdir='/home/cvsroot'   #cvs代码存放目录
data=time.strftime('%y-%m-%d')
cvstarfile="cvsroot"+data+".tgz"
global fd

if not os.path.isdir(home):
    os.mkdir(home)
os.chdir(home)
lastfilelen = os.path.getsize(glob.glob("*.tgz")[-1])
cmd = "tar zcvf "+cvstarfile+" "+cvsdir
if (os.system(cmd))!=0:
    print "tar file faild! cmd:[%s]"%(cmd)
    sys.exit(1)

newfilelen = os.path.getsize(cvstarfile)
print "new:%d,old:%d"%(newfilelen,lastfilelen)
if (newfilelen == lastfilelen):
    print "file size not change! exit!"
    sys.exit(0)

print "while upload file:%s,size:%d"%(cvstarfile,newfilelen)
if os.getcwd()==home:
    ftp=ftplib.FTP(ftphost,ftpuser,ftppass)
    ftp.set_pasv(ftppassmode)
    ftp.cwd(ftpdir)
    paths=ftp.nlst('cvsroot*')
    print paths
    if len(paths) > 5:
        ftp.delete(paths[0])
        os.remove(paths[0])
    fd = open(cvstarfile, 'rb')
    ftp.storbinary('STOR %s' % os.path.basename(cvstarfile), fd)
    fd.close()
    ftp.quit()

[/code]

然后在crontab里面加一行就每天定时启动的命令就可以了!

0 1 * * * Python /root/backcvs/backcvs.py

 

 

给MATLAB安装runtime插件 输入你刚刚下载压缩包的位置(小白提示:在 此电脑 中找到压缩包位置,右键属性复制位置)(!设置好以后然后填写下面输出exe文件的信息,包括文件的名字、作者、Email、公司、概述、描述,下面还可以选择额外的安装选项,exe文件运行需要的其他文件(图像、子程序等)、提供给用户的文件(readme.txt等)(很多方法是官网下载,但在官网下载还是会版本不对应,所以直接在你所用的MATLAB里搜索安装链接最靠谱)(!5.可以打包程序了(你发送文件的人电脑里没有MATLAB也可以查看运行你的程序了) 阅读详情

相关推荐

告别 RPA 和 Selenium,MCP + Playwright 成为自动化开发新宠!

摘要: 随着数字化转型加速,传统自动化工具(如RPA和Selenium)在复杂场景中暴露出开发成本高、灵活性不足等问题。新一代解决方案MCP(Model Context Protocol)与Playwright的结合,通过AI与自动化的无缝对接,实现了智能化的任务处理。MCP支持自然语言交互和上下文感知,开发者无需编写复杂代码即可生成自动化脚本;Playwright则提供多浏览器支持、高性能和易用性。二者结合显著提升开发效率,使自动化更智能、灵活。文章还对比了VS Code与Trae中配置Playwrigh

我先测了 2211

CVS 自动备份解决方案

课题要求:有两台以LINUX为环境的服务器都安装了CVS,一台是常用的称为 服务器A , 另一台是备份用的称为 服务器B。现在要求每天将服务器A上的CVS内容自动备份到服务器B的CVS上去,并且每个月产生一个版本。一旦服务器A 发生故障,可以立即使用服务器B上的CVS。方案前期准备:1,服务器A   服务器B 上已经安装了 两个一模一样的CVS, 包括希望备份的项目,可以访问的用户名密码等。2,两台服务器之间的网络访问正常。3,已经安装了expect 解决方案:1,CVS有 Export 命令, 可以利用这

moonlit1228的专栏 2324

Keysight ADS新手必看:3分钟搞定TDR模拟的保姆级教程(附差分信号设置技巧)

本文为Keysight ADS新手提供TDR模拟的保姆级教程,详细介绍了从基础环境准备到差分信号设置的全流程。通过内置模板调用、待测器件连接和仿真结果解读,帮助用户快速掌握TDR模拟技术,特别包含差分信号配置技巧,提升信号完整性分析效率。

weixin_30872157的博客 201

linux cvs 客户端迁移,Linux下CVS库迁移到SVN库攻略

Linux下CVS库迁移到SVN库攻略转换步骤: 1、 CVS库要备份好(直接copy CVS模块的内容); 2、 SVN服务器要装好; 3、 CVS2SVN安装; 4、 转换后的测试。安装软件的版本 cvs版本:1.12.12 svn版本:1.4.6cvs2svn版本:2.3.0下载:cvs2svn安装:cd /usr/softwaretar -zxf cvs2svn-1.2.1.tar.gz ...

weixin_34377037的博客 216

告别Keil!用VSCode+PlatformIO玩转STC单片机(附自动下载配置)

本文详细介绍了如何从Keil迁移到VSCode+PlatformIO进行STC单片机开发,包括环境搭建、自动下载配置等实用技巧。通过对比传统IDE与现代工具链的差异,展示了VSCode+PlatformIO在代码编辑体验、跨平台支持和开发效率上的优势,帮助开发者实现更流畅的STC单片机开发流程。

weixin_27252001的博客 460

Redhawk: dynamic ir drop分析(Clock Buffer Clustering)

在dynamic分析中,ir drop问题多出现在三种情况下,缺power mesh,缺power switch,clock cell过于密集。 前两种情况通过选中具体instance查看min res path都比较容易分析出来,而且大部分问题都出现在channel里,这里不多做赘述。 clock cell过于密集这是观察结果,缺少报告支持,这里分享一下分析方法。 首先,选中压降超过signoff标准的instance,(Results->List of Worst Instance DVD中

m0_61544122的博客 5279

cvs导出

下级更精彩

qq_38921346的博客 331

基于英特尔 RealSense D455 相机实现裂缝尺寸以及深度测量

D455 相机可用于对这些零部件进行高精度的表面检测,快速准确地测量裂缝的尺寸和深度,实现自动化的质量控制和缺陷筛查,提高生产效率和产品质量。D455 相机能够对焊缝表面进行细致扫描,测量焊缝的宽度、深度以及焊缝表面的不规则程度等参数,帮助检测焊缝是否存在缺陷,如未焊透、焊瘤等,为焊接质量的评估和改进提供数据支持。:RGB 传感器采用全局快门,并且其视场与深度视场相匹配,能够提供更出色的 RGB 图像质量,以及深度图像和 RGB 图像之间的更好对应性,从而可提高扫描质量。可以看出宽度和高度都是十分准确的。

qq_53545309的博客 1716

CVS 备份、分发、简化您的配置文件 from [http://www-900.ibm.com/developerWorks/cn/linux/]

CVS 备份、分发、简化您的配置文件 级别: 初级 Teodor Zlatanov (tzz@bu.edu) 程序员, Gold Software Systems2004 年 7 月 一般的开发者用于定位、学习和调试配置文件的所花费的时间,比您预期的要更长。不过,使用一个您可能每天都在用的工具: CVS 树,您就可以节约那些时间——并减轻精力和挫折的负担。使用这些技巧来备份、发布最令您头

心气极 3567

Python爬虫实战:构建高可用静态网页爬虫 - 以 Quotes 网站数据采集为例!

我长期专注 Python 爬虫工程化实战,主理专栏 《Python爬虫实战》:从采集策略到反爬对抗,从数据清洗到分布式调度,持续输出可复用的方法论与可落地案例。内容主打一个“能跑、能用、能扩展”,让数据价值真正做到——抓得到、洗得净、用得上。

喵手的博客 462

pandas教程:2012 Federal Election Commission Database 2012联邦选举委员会数据库

里面包含了支持者的名字,职业和雇主,地址,赞助金额。我们可以已经能想到如何切割、整理数据,来提取赞助者的统计数据,或提取宣传活动的模式,这里我们展示一些不同的分析方法。可以看到有些职业是同一种工作类型,指代的是同一个东西。这两个连续操作是分别独立执行的,一个结束后,另一个才开始。上,这里我是把数据集压缩成了ZIP格式,解压后能正常导入)。我觉得也有必要好好了解一下,这个网站做了很好的讲解,),所以我们最好添加这样的信息。这样的情况,即把两个索引操作连在一起。,发现映射关系被正常执行了,所以这里的。

Cachel Wood的博客 351

CVS文件导入导出

public partial class Salepromotion_SendCoupon : System.Web.UI.Page {     DevExpress.Xpo.Session s;     protected void Page_Init(object sender, EventArgs e)     {         s = EC.Module.XpoHelper.G

goodyatou的专栏 3529

手把手教你学simulink(31.17)--双向DCDC电源场景示例:基于simulink 的双向DCDC应用:车载充电器的pi控制

通过引入PI控制器,系统可以更精确地控制电压和电流,确保充电和放电过程的稳定性和高效性。

MHD0815的博客 208

crontab 自动备份 cvs

1.创建备份路径,如:­ #mkdir –p /home/cvsbak­ 2.创建备份脚本,如:­ #cd /home/cvsbak­ #touch bakup.sh­ #chmod 775 bakup.sh­ #vi bakup.sh­ 3.输入bakup.sh的内容如下:­ #/bin/sh­ now=`date +%Y%m%d`­ bakfile=cvs$now...

decn33932的博客 158

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

Linux下备份cvs数据库shell脚本

#!/bin/sh DISK_SIZE=`df -k|grep /dev/sda7 |awk '{ print substr($5,1,2) }'` todate=`date +%Y%m%d_%w` thrday=`date -d '3 days ago' +%Y%m%d_%w` if [ $DISK_SIZE -gt 85 ]; then echo DISK_SIZE is $DISK_SIZE over 85 exit else ech

kardelpeng的专栏 1489

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

cvs错误解决和备份

前提条件:cvsnt和wincvs都在一个电脑上。在cvsnt和wincvs设置和登录都成功的前提下,创建新的Repository时候,发生以下错误:cvs [server aborted]: Protocol error: Root request missing通过试验发现,不应该和设置的时候一样将认证方式设置成:pserver协议,而应该设置成local协议。另外,备份cvs

支持开源,支持java,支持Linux 2026

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

CVS导出项目

初出茅庐的我,什么都不懂。只是将自己学的东西一点一滴的写在博客上,为以后回顾留有一定的资料: CVS导出项目: 1、选择show view面板找到cvs Repositories 2、在弹出的cvs面板中点击右键new Repo... 3、配置服务器下载项目 根据自己的情况而定 完成之后我们check out即可。 在项目开发过程中最常用则是update 和com...

114

记一次自动导出CVS配置始末

一开始的shell如下: #!/bin/bash export NLS_LANG="SIMPLIFIED CHINESE_CHINA".ZHS16GBK $ORACLE_HOME/bin/sqlplus -S fdm/fdm\$ane_56 > /dev/null 2>&1 <<EOF set echo off feedback off trimspool on linesize 3000;

u010551713的博客 487

Proxy4Free代理服务器转换为Maxthon(MYIE2)配置

这是我的第一篇blog,希望对大家有用。为了方便更新Maxthon代理服务器,写了个python脚本。处理proxy4free得到的代理服务器文件,验证代理服务器,按照响应速度排序,生成maxthon配置格式输出。下面为文件:proxy2maxthon.py从http://www.proxy4free.com/page1.html得到代理信息,输出为maxthon(MyIE2格式的代理信息)

喝茶,听音乐,写程序! 9254
上一篇: 我又回来了!
下一篇: 转化iRiver的歌词文件SNC到标准歌词文件lrc的python代码
invalid
博客等级 码龄26年 31粉丝 18原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值