惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Last Watchdog
The Last Watchdog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
C
Check Point Blog
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
V
Vulnerabilities – Threatpost
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
S
Security @ Cisco Blogs
IT之家
IT之家
T
The Exploit Database - CXSecurity.com
The GitHub Blog
The GitHub Blog
D
Docker
Engineering at Meta
Engineering at Meta
AWS News Blog
AWS News Blog
S
Security Affairs
U
Unit 42
P
Palo Alto Networks Blog
V
Visual Studio Blog
Y
Y Combinator Blog
D
DataBreaches.Net
Forbes - Security
Forbes - Security
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
Security Latest
Security Latest
aimingoo的专栏
aimingoo的专栏
Simon Willison's Weblog
Simon Willison's Weblog
A
Arctic Wolf
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hacker News: Front Page
博客园 - 司徒正美
博客园 - Franky
宝玉的分享
宝玉的分享
TaoSecurity Blog
TaoSecurity Blog
Latest news
Latest news
Scott Helme
Scott Helme
MongoDB | Blog
MongoDB | Blog
量子位
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cisco Blogs
P
Privacy International News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog

Hyde Blog

Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog 关于我 关于我 Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog
Hyde Blog
Hyde · 2025-10-05 · via Hyde Blog

一键推送 ​

版权 ​

场景 ​

将打包好的文件一键推送都服务器目录,无需手动上传,方便快捷。

准备工作必须

  • rsync 实现 windows 与 linux 数据备份同步

  • 切换到您项目的指定目录

    bash

    #示例 [软件名]@[计算机名] [终端类型] [当前路径] ([Git分支])
    
    [软件名]@[计算机名] [终端类型] /D/code/zhishiku/vitepress-theme-teek-hyde (dev)
    $ cd /d/code/teek-hyde
    
    [软件名]@[计算机名] [终端类型] /d/code/teek-hyde (main)   #已成功切换到该路径以及对应的分支
    $

创建 ​

  • 在项目根目录下创建Shell文件夹,并在Shell文件夹下创建命令.sh password.txtteek-run-build.shteek-run-dev.shteek.batteek.sh文件

bash

# 创建Shell文件夹
mkdir -p Shell

# 在Shell文件夹下创建password.txt文件
touch Shell/password.txt

# 在Shell文件夹下创建teek-run-build.sh文件
touch Shell/teek-run-build.sh

# 在Shell文件夹下创建teek-run-dev.sh文件
touch Shell/teek-run-dev.sh

# 在Shell文件夹下创建teek.bat文件
touch Shell/teek.bat

# 在Shell文件夹下创建teek.sh文件
touch Shell/teek.sh

提示

teek.bat 参数说明:

  • --password-file= :指定包含 rsync 密码的文本文件路径(需用 600 权限保护)
  • /cygdrive/d/ :Cygwin 环境下 Windows D 盘的路径映射
  • root@您云服务器 ip (需替换实际 IP)
  • ::teek.seasir.top :rsync 服务模块路径(需替换实际模块名)

注意事项:

  1. 8730 端口需确保云服务器防火墙已放行,指定 rsync 服务监听的端口号。默认情况下,rsync 服务监听 873 端口
  2. 首次运行建议先加 --dry-run 参数模拟测试

请把/d/code/teek-hyde路径换成你自己的实际路径

命令.shpasswordteek-run-buildteek-run-devteek.batteek.sh

bash

cat >>/etc/profile <<EOF
alias td="
sh -x /d/code/teek-hyde/Shell/teek-run-dev.sh
"
EOF

cat >>/etc/profile <<EOF
alias tb="
sh -x /d/code/teek-hyde/Shell/teek-run-build.sh
"
EOF


cat >>/etc/profile <<EOF
alias hxx="
sh -x /d/code/teek-hyde/Shell/teek.sh
"
EOF


cat >>/etc/profile <<EOF
cd /d/code/teek-hyde/
alias gg="
git status
git pull
git add -A
git commit -m'commit data'
git push
git status
"
EOF

source /etc/profile

bash

password.txt 文件用于存放 rsync 推送服务器密码,格式:`123456`

bash

cd /d/code/teek-hyde
pnpm docs:build

bash

cd /d/code/teek-hyde
pnpm docs:dev

bash

rsync.exe -avPzruh --delete --port 8730 --password-file=/cygdrive/d/code/teek-hyde/Shell/password.txt
/cygdrive/d/code/teek-hyde/docs/.vitepress/dist root@您的云服务器IP::teek.seasir.top

bash

#!/bin/bash

#提交
cd /d/code/teek-hyde
git status
git pull
git add -A
git commit -m"update data"
git push
git status

#构建
cd /d/code/teek-hyde
pnpm docs:build


git status
git pull
git add -A
git commit -m"update data"
git push
git status


echo "推送winodws site数据到ecs:"
/d/code/teek-hyde/shell/teek.bat
echo "rsync: rsync数据winodws-->ecs推送成功!"
echo ""
echo ""

echo "***************************"
echo "当前仓库状态:"
git status

脚本 ​

  • 直接在 vscode 里bash控制台执行如下代码就好

警告

执行下面代码之前,请先把/d/code/teek-hyde路径换成你自己的实际路径

sh

cat >>/etc/profile <<EOF
alias td="
sh -x /d/code/teek-hyde/Shell/teek-run-dev.sh
"
EOF

cat >>/etc/profile <<EOF
alias tb="
sh -x /d/code/teek-hyde/Shell/teek-run-build.sh
"
EOF


cat >>/etc/profile <<EOF
alias hxx="
sh -x /d/code/teek-hyde/Shell/teek.sh
"
EOF


cat >>/etc/profile <<EOF
cd /d/code/teek-hyde/
alias gg="
git status
git pull
git add -A
git commit -m'commit data'
git push
git status
"
EOF

source /etc/profile

拓展配置 ​

  • 控制台bash输入hxx,此命令是自定义的,可以在 bash 控制台输入下面命令进行自定义

sh

#查看配置文件
cat /etc/profile

#编辑配置文件
vim /etc/profile

#清空配置文件
sudo truncate -s 0 /etc/profile

#重新加载配置文件
source /etc/profile

找到 hxx,改成自己的

sh

alias hxx="
sh -x /d/code/teek-hyde/Shell/teek.sh
"
  • 清除 /etc/profile 文件中的所有内容 truncate 命令可以调整文件的大小,将文件大小设置为 0 就相当于清空文件内容。执行以下命令:

sh

sudo truncate -s 0 /etc/profile

验证脚本 ​

shell

source /etc/profile  #控制台没有输出说明成功
tb  # 测试别名是否生效

cat /etc/profile #或者直接查看是否生效

服务端配置 ​

  • 安装并启动 rsync 服务,详细查看:rsync 实现 windows 与 linux 数据备份同步

  • 创建 rsyncd.conf 文件

  • 填写rsyncd.conf文件配置

    sh

    [cmi-vue]
    # 同步的目标文件夹
    path=/root/rsync/rsync-vue
    # rsync daemon 在传输前是否切换到指定的 path 目录下,并将其监禁在内,用于增加传输的安全性
    use chroot=no
    # 指定最大的连接数
    max connections=4
    # yes 表示只读本地文件无法同步到服务器
    read only=no
    # 客户端请求显示模块列表时,该模块是否显示出来
    list=true
    # 服务运行时的用户
    uid=root
    # 服务运行时的用户组
    gid=root
    # 进行验证时的用户名,必须是系统存在的用户
    auth users = root
    # 连接用户时的密码
    secrets file=/etc/rsyncd.passwd
    # 允许的 ip
    hosts allow=*
  • 接着在服务器/root/rsync/rsync-vue创建此文件夹,名称随意,但需要和前面保持一致~

    sh

    mkdir -p /root/rsync/rsync-vue

验证 ​

  • bash控制台输入hxx,查看是否成功