这是本文档旧的修订版!


常用命令

启动本地 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

文件同步

删除过期文件

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

Restic 备份到仓库 restic 命令

sudo restic -r sftp:$ftpnas/mongo-repo --verbose backup /mnt/mongodb/data/
# 查看备份情况
restic -r sftp:mai@mainserver:/home/mai/mongobackup/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.1633159198.txt.gz · 最后更改: 2021-10-02 07:19 由 goldentianya
回到顶部
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0