目前我正在使用以下简单的线路脚本将服务器目录备份到远程FTP位置 # Take backup to remote location ncftpput -z -R -uusername -ppassword ftp.example.org /destination/directory /source/directory 现在,我只需要从超过7天的远程FTP删除备份。 在服务器内的正常目录位置,我简单地用下面的脚本来完成 # Delete backups older than 7 days find /backup -name '*' -type d -mtime +6 -exec rm -rfv "{}" \; 但是,运行相同的FTP不工作,有什么办法可以删除超过7天的FTP远程位置数据? 可能是通过lftp或任何其他命令
我正在创build一个在远程服务器上使用几个“Invoke-Command -asjob”的脚本,虽然在testingWhile-Loop时狂奔,我不得不阻止它。 但是,当我现在在目标服务器上尝试一个Invoke-Command -asjob时,它会返回状态为失败的作业。 当我收到作业时,返回这个错误: The WS-Management service cannot process the request. This user has exceeded the maximum number of concurrent shells allowed for this plugin. Close at least one open shell or raise the plugin quota for this user. + FullyQualifiedErrorId : -2144108060,PSSessionStateBroken 当我做Get-PSSession时,没有列出,所以我不能使用Remove-PSSession(这是迄今为止Google的唯一build议)。 这是它基本上执行的: While ($True) { Invoke-Command -Computername $RemoteServer -AsJob {Get-ChildItem} } […]
ls "d:\" "yasuo500" -recurse -directory 这个命令在d:\ media \ documents中find文件夹'yasuo500',我想用'cd'进入那个目录,但是怎么做? 我试过这个: $path1 = ls "d:\" "yasuo500" -recurse -directory cd $path1 但它不工作,它说cd : cannot find path 'c:\yasuo500' because it does not exist. 我究竟做错了什么? 请记住,我可以做 cd "d:\media\documents\yasuo500" 但是…这不是很有效率,如果目录很长,我会input太多的内容。
在我的系统中, df -hT输出如下所示: > df -hT Sist. Arq. Tipo Tam. Usado Disp. Uso% Montado em devtmpfs devtmpfs 1,9G 8,0K 1,9G 1% /dev tmpfs tmpfs 1,9G 616K 1,9G 1% /dev/shm tmpfs tmpfs 1,9G 1,8M 1,9G 1% /run tmpfs tmpfs 1,9G 0 1,9G 0% /sys/fs/cgroup /dev/sda6 btrfs 80G 22G 58G 27% / /dev/sda6 btrfs 80G 22G 58G […]
我想通过电子邮件发送一个HTML文件和一些图片给一个脚本的人。 标准答案似乎是使用mutt 。 不过我目前没有安装。 有另外一种方法可以做到吗? 安装mutt有没有什么安全漏洞? 我不需要一个完整的邮件阅读器,我只是想发送一些附件,有没有另一种解决scheme?
我有以下的工作正常的bash脚本。 #!/bin/bash OUTFILE=somefile.txt ( ./runnable input << EOF 2 4 EOF ) > $OUTFILE 但后来我需要改变论据。 目录中有100个文件,每个文件有两个数字。 这两个数字需要反馈给上面的脚本。 100个文件有这样的数据: 2,4 9,2 4,2 所以我改变了脚本以下,但这似乎并没有工作。 #!/bin/bash OUTFILE=file3.txt ( while read line do ./runnable input << EOF #following gets first number before comma test=$(echo `expr index "$line" ,` ) echo ${line:0:($test-1)} line=$(echo ${line:$test}) #following gets second number after comma […]
我试图确定给定的虚拟机是否正在使用shell脚本运行。 当手动运行时,“virsh list | grep MediaWiki”命令在虚拟机正在运行时返回一行,如果没有,则返回任何内容。 我正在尝试使用: if [`virsh list | grep MediaWiki` !== ""] then echo "The MediaWiki VM is Running!" else echo "Not Running!" fi 但是我不认为我的语法是正确的。 用上面的代码,它声称机器正在运行,不pipe它是否。
我最近注意到Windows Powershell v1.0安装在Windows 7 RTM上,所以我需要安装Powershell v2.0 CTP 3,但是在“卸载程序”中找不到它,并且试图在“打开/closuresWindowsfunction“,我怎么能做到这一点? 谢谢
每当新的邮件被发送到虚拟邮箱时,我可以在哪里告诉exim运行shell / php命令。 邮件送达哪个用户并不重要?
我想用stdin的内容更新/清新zip档案中的档案。 到目前为止,我还没有find一种方法来告诉zip命令stdin的内容对应于一个特定的文件。 例如(最后一行是我期望它的工作,但不会对zip文件进行任何更改): ~/D/tmp ♪ unzip -l sample.odt # an odt file is actually a zip file Archive: sample.odt Length Date Time Name ——– —- —- —- 39 01-06-10 00:46 mimetype 0 01-06-10 00:46 Configurations2/statusbar/ 0 01-06-10 00:46 Configurations2/accelerator/current.xml 0 01-06-10 00:46 Configurations2/floater/ 0 01-06-10 00:46 Configurations2/popupmenu/ 0 01-06-10 00:46 Configurations2/progressbar/ 0 01-06-10 00:46 Configurations2/menubar/ […]