常用命令

启动本地 docsify 以及 localservice 服务
bash -c "nohup sh -c 'docsify serve ~/projects/tianyawiki/docs/' >/dev/null 2>&1 &"
bash -c "nohup sh -c 'node ~/projects/localservice/app.js' >/dev/null 2>&1 &"
# 忽略全部输出
bash -c "nohup sh -c 'command...' >/dev/null 2>&1 &"
# 挂载OneDrive 
sudo rclone mount gdrive: ~/gdrive --allow-other --daemon &
备份数据
# 整个工程目录
rsync -avzP --delete --exclude='node_modules' --exclude='www' --exclude='.git' --exclude='platforms' /Users/mai/projects/ /Volumes/work/projectes

Rclone 挂载

复制ssh-key ssh-keygen ssh-copy-id -i ~/.ssh/id_rsa.pub mai@mainserver

检查地址

curl ifconfig.me

当前地址为 88.152.216.188 ping mai-ubun

文件同步

删除过期文件

cd /path.../
find  .  -mtime  +3 | xargs rm

选择一个网络驱动器,并右键在 Terminal 中打开,就可以使用命令。RSYNC 备份服务

rsync -avzP --delete --exclude='node_modules' /Users/mai/Stock ./Stock
# 一定要加“./Stock”,单单一个“.” 会覆盖整个根目录

将工程同步到主力服务器

rsync -avzP --delete --exclude='node_modules' /Users/mai/projects/financial/apis mai@mainserver:/home/mai/projects/stockapis

// 同步工程到网络驱动器 -anv 模拟 -av 实际传输
rsync -avzP --delete --exclude='node_modules' /Users/mai/projects/* /Volumes/work/projectes
rsync -avzP --delete --exclude 'node_modules' --exclude '.git' /Users/mai/projects/* /Volumes/work/projectes

同步时使用远程登录比用samba网络硬盘快很多。

增量备份

主要的工作目录

rsync -av --delete --exclude='node_modules' --exclude='.git' --exclude='.DS_Store' --link-dest=../rsync/Stock /Users/mai/Stock/* root@serverpi:/mnt/hdisk/work/Stock
rsync -av --delete --exclude='node_modules' --exclude='.git' --exclude='.DS_Store' --link-dest=../rsync/projects /Users/mai/projects/* root@serverpi:/mnt/hdisk/work/projects
rsync -av --delete --exclude='node_modules' --exclude='.git' --exclude='.DS_Store' --link-dest=../rsync/Gitbook /Users/mai/Gitbook/* root@serverpi:/mnt/hdisk/work/Gitbook
// 备份文档
rsync -av --delete --exclude='node_modules' --exclude='.git' --exclude='.DS_Store' --link-dest=../rsync /Users/mai/文件/* root@serverpi:/mnt/hdisk/docs/个人文档

Restic 备份到仓库 restic 命令

sudo restic -r sftp:$ftpnas/mongo-repo --verbose backup /mnt/mongodb/data/
# 查看备份情况
sudo restic -r sftp:$ftpnas/dokuwiki-repo snapshots

Restic 删除旧版本

restic -r sftp:$ftpnas/dokuwiki-repo forget --keep-last 1 --prune

Conf

Nginx

cd /etc/nginx/sites-available
/home/ubuntu/www/html/data/pages
wiki/shortcut.txt · 最后更改: 2022-08-11 12:50 由 goldentianya
回到顶部
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0