linux小命令集合
du -sh * 查看当前目录下的当前子目录的内存大小
df -h 查看内存占用情况
tar -xvf src.tgz ; rsync -avzL src/ desc/ linux增量发布代码命令(如果想过滤一些文件时可以在rsync 中加参数u)
#!/bin/bash
#--include 同步的目录
#--exclude 排除的文件
#rsync [选项] [scr] [decs]
增量同步/发包 rsync -azvuL
#--include 同步的目录
#--exclude 排除的文件
#rsync [选项] [scr] [decs]
增量同步/发包 rsync -azvuL
备份
rsync -azvuL --delete --include "app" --include "statics" --include "vendor" --exclude "app/config/db.php" --exclude "/*" /data/www/beta/ /data/www/test/
恢复
rsync -azvL --delete --include "app" --include "statics" --include "vendor" --exclude "app/config/db.php" --exclude "/*" /data/www/beta/ /data/www/test/
注:
使用-c 是打开校验打开,强制对文件传输进行校验
rsync -azvuL --delete --include "app" --include "statics" --include "vendor" --exclude "app/config/db.php" --exclude "/*" /data/www/beta/ /data/www/test/
恢复
rsync -azvL --delete --include "app" --include "statics" --include "vendor" --exclude "app/config/db.php" --exclude "/*" /data/www/beta/ /data/www/test/
注:
使用-c 是打开校验打开,强制对文件传输进行校验