Linux運維新人自用筆記(Rsync遠程傳輸備份,服務端、郵箱和客戶端配置、腳本)

內容全為個人理解和自查資料梳理,歡迎各位大神指點!

每天學習較為零散。

day24

一、Rsync傳輸文件

#安裝rsync#-a遞歸同步(包含子目錄)保留文件權限、所有者、組、時間戳等元數據
#??-z傳輸時壓縮數據
#??-v顯示詳細同步過程
#??-P??顯示傳輸進度  #傳輸目錄 #加/  /my_smb/ 表示拷貝該目錄下所有文件   
[root@01c/]# rsync -azvP /my_smb/ /my_test/
sending incremental file list
./
Windows_put.txt0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=1/3)
sam.txt0 100%    0.00kB/s    0:00:00 (xfr#2, to-chk=0/3)sent 203 bytes  received 57 bytes  520.00 bytes/sec
total size is 0  speedup is 0.00
[root@01c/]# ls /my_test/
233.jpg  sam.txt  Windows_put.txt#不加/  /my_smb  表示拷貝該目錄
[root@01c/]# rsync -azvP /my_smb  /my_test/
sending incremental file list
my_smb/
my_smb/Windows_put.txt0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=1/3)
my_smb/sam.txt0 100%    0.00kB/s    0:00:00 (xfr#2, to-chk=0/3)sent 219 bytes  received 58 bytes  554.00 bytes/sec
total size is 0  speedup is 0.00
[root@01c/]# ll /my_test/
total 0
drwxrwxrwx 2 samba01 samba01 44 Jul 24 18:56 my_smb


#傳輸單個小文件
[root@01c/]# rsync -azvP /my_smb/Windows_put.txt  /my_test/
sending incremental file list
Windows_put.txt0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=0/1)sent 112 bytes  received 35 bytes  294.00 bytes/sec
total size is 0  speedup is 0.00
[root@01c/]# ls /my_test/
Windows_put.txt#傳輸時排除隱藏文件和目錄
[root@01c/my_test]# rsync -avzP --exclude=.*  /my_test/  /my_smb/#傳輸單個大文件  --bwlimit 限速,限制傳輸單個大文件時占用的磁盤io[root@01c/]# dd bs=50M count=2 if=dev/zero of=/my_smb/100M.log
2+0 records in
2+0 records out
104857600 bytes (105 MB) copied, 0.549043 s, 191 MB/s
[root@01c/]# rsync -avzP  --bwlimit=10 /my_smb/100M.log  /my_test/
sending incremental file list
100M.log104,857,600 100%   25.91MB/s    0:00:03 (xfr#1, to-chk=0/1)sent 102,065 bytes  received 35 bytes  9,723.81 bytes/sec
total size is 104,857,600  speedup is 1,027.01
#鏡像同步(源和目標完全一致)
# /my_test/test01/源目錄,末尾的 /表示同步目錄??內容??(不包含目錄本身) /my_test/test02/目標目錄
#01中的文件會傳輸給02
[root@01c/my_test/test02]# rsync -avzP --delete /my_test/test01/ /my_test/test02/
sending incremental file list
./
aabb0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=3/5)
ccdd10 100%    0.00kB/s    0:00:00 (xfr#2, to-chk=2/5)
ccdd20 100%    0.00kB/s    0:00:00 (xfr#3, to-chk=1/5)
ccdd30 100%    0.00kB/s    0:00:00 (xfr#4, to-chk=0/5)sent 259 bytes  received 95 bytes  708.00 bytes/sec
total size is 0  speedup is 0.00[root@01c/my_test/test01]# ll 
total 0
-rw-r--r-- 1 root root 0 Jul 24 19:12 aabb
-rw-r--r-- 1 root root 0 Jul 24 19:14 ccdd1
-rw-r--r-- 1 root root 0 Jul 24 19:14 ccdd2
-rw-r--r-- 1 root root 0 Jul 24 19:14 ccdd3[root@01c/my_test/test02]# ll
total 0
-rw-r--r-- 1 root root 0 Jul 24 19:12 aabb
-rw-r--r-- 1 root root 0 Jul 24 19:14 ccdd1
-rw-r--r-- 1 root root 0 Jul 24 19:14 ccdd2
-rw-r--r-- 1 root root 0 Jul 24 19:14 ccdd3[root@01c/my_test/test02]# touch test{1..5}
[root@01c/my_test/test02]# ll
total 0
-rw-r--r-- 1 root root 0 Jul 24 19:12 aabb
-rw-r--r-- 1 root root 0 Jul 24 19:14 ccdd1
-rw-r--r-- 1 root root 0 Jul 24 19:14 ccdd2
-rw-r--r-- 1 root root 0 Jul 24 19:14 ccdd3
-rw-r--r-- 1 root root 0 Jul 24 19:19 test1
-rw-r--r-- 1 root root 0 Jul 24 19:19 test2
-rw-r--r-- 1 root root 0 Jul 24 19:19 test3
-rw-r--r-- 1 root root 0 Jul 24 19:19 test4
-rw-r--r-- 1 root root 0 Jul 24 19:19 test5#如果02目錄里有01目錄中沒有的文件,例如test{1..5},這些文件會被??永久刪除
[root@01c/my_test/test02]# rsync -avzP --delete /my_test/test01/ /my_test/test02/
sending incremental file list
deleting test5
deleting test4
deleting test3
deleting test2
deleting test1
./sent 115 bytes  received 64 bytes  358.00 bytes/sec
total size is 0  speedup is 0.00
#編輯01目錄的test1 完全鏡像后會重新同步進02目錄
[root@01c/my_test/test01]# vim test1
[root@01c/my_test/test01]# rsync -avzP --delete /my_test/test01/ /my_test/test02/
sending incremental file list
./
test110 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=4/10)sent 241 bytes  received 38 bytes  558.00 bytes/sec
total size is 10  speedup is 0.04

?Rsync遠程備份文件

大文件可以用--bwlimit 限速,限制傳輸大文件時占用的寬帶

發送

#rsync -avzP /本機需要備份的目錄/  備份機用戶名@備份機IP:/備份機目錄/
#01c機的數據[root@01c/my_test/test02]# rsync -avzP /my_test/  root@192.168.195.123:/test_file/
The authenticity of host '192.168.195.123 (192.168.195.123)' can't be established.
ECDSA key fingerprint is SHA256:7/ofSV+xfCRuwEcQXC5UxjVMG1hVruPIrWQxlhFhgvw.
ECDSA key fingerprint is MD5:fc:a9:52:a6:bb:8b:7d:8a:bf:12:51:61:30:e3:8c:8a.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '192.168.195.123' (ECDSA) to the list of known hosts.
root@192.168.195.123's password: 
sending incremental file list
./
test01/
sent 1,077 bytes  received 373 bytes  126.09 bytes/sec
total size is 20  speedup is 0.01#01c的數據備份在02c的  /test_file/ 目錄下
[root@02c/test_file]# ll
total 0
-rw-r--r-- 1 root root   0 Jul 23 16:18 233.txt
drwxr-xr-x 2 root root 122 Jul 24 19:32 test01
-rw-r--r-- 1 root root   0 Jul 23 16:12 test_012_get.txt
drwxr-xr-x 2 root root 122 Jul 24 19:32 test02
[root@02c/test_file]# 

獲取?

#rsync -avzP 對方用戶名@對方機IP:/需要獲取的資源目錄/ /本機目錄/
#02c機獲取01c機的資源[root@02c/test_file]# rsync -avzP root@192.168.195.189:/my_test/ /test_file/
The authenticity of host '192.168.195.189 (192.168.195.189)' can't be established.
ECDSA key fingerprint is SHA256:7/ofSV+xfCRuwEcQXC5UxjVMG1hVruPIrWQxlhFhgvw.
ECDSA key fingerprint is MD5:fc:a9:52:a6:bb:8b:7d:8a:bf:12:51:61:30:e3:8c:8a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.195.189' (ECDSA) to the list of known hosts.
root@192.168.195.189's password: 
receiving incremental file list
./
test01/0 100%    0.00kB/s    0:00:00 (xfr#9, to-chk=9/21)
test02/sent 381 bytes  received 1,073 bytes  171.06 bytes/sec
total size is 20  speedup is 0.01#02c機中 將01c數據存放在 /test_file/ 目錄下
[root@02c/test_file]# ll
total 0
-rw-r--r-- 1 root root   0 Jul 23 16:18 233.txt
drwxr-xr-x 2 root root 122 Jul 24 19:32 test01
-rw-r--r-- 1 root root   0 Jul 23 16:12 test_012_get.txt
drwxr-xr-x 2 root root 122 Jul 24 19:32 test02
[root@02c/test_file]# 

二、Rsync服務端

rsync借助ssh協議同步數據存在缺陷,使用root用戶不安全,普通用戶可能導致權限不足。

所以用rsync的守護程序傳輸方式,不使用root系統用戶更安全并且有權限。

Rsync的配置設置

[root@01c/]# vim /etc/rsyncd.conf uid = work_rsyncd
gid = work_rsyncd
port = 873
fake super = yes
use chroot = no
max connections = 200
timeout = 600
ignore errors = yes
read only = false
auth users = rsync_backup   #用于客戶端登陸的用戶名
secrets file = /etc/rsync.passwd   #密碼文件
log file = /var/log/rsync.log     #日志
[backup]                        #用于客戶端備份的模塊設置和目錄
path = /backup
comment = Backup Directory
read only = false[data]
path = /data
comment = Data Directory
read only = false

創建用戶以及目錄?

#創建不能登陸的賬號,僅用于運行進程
[root@01c/my_test]# useradd -u 1999 -M -s /sbin/nologin work_rsyncd#創建rsync配置里需要的目錄
[root@01c/my_test]# mkdir -p /data/ /backup#修改目錄所屬
[root@01c/my_test]# chown -R work_rsyncd:work_rsyncd  /data/
[root@01c/my_test]# chown -R work_rsyncd:work_rsyncd  /backup/[root@01c/my_test]# ll -d /data/ /backup/
drwxr-xr-x 2 work_rsyncd work_rsyncd 6 Jul 24 23:21 /backup/
drwxr-xr-x 2 work_rsyncd work_rsyncd 6 Jul 24 23:21 /data/

創建虛擬用戶密碼文件?

#創建密碼文件設置賬號和密碼,用于客戶端連接時的認證
[root@01c/my_test]# vim /etc/rsync.passwd
[root@01c/my_test]# cat /etc/rsync.passwd 
rsync_backup:zxcvbn#密碼文件權限600
[root@01c/my_test]# chmod 600 /etc/rsync.passwd 
[root@01c/my_test]# ll /etc/rsync.passwd 
-rw------- 1 root root 20 Jul 24 23:37 /etc/rsync.passwd
#啟動,查看狀態log
[root@01c/my_test]# systemctl start rsyncd
[root@01c/my_test]# systemctl status rsyncd
● rsyncd.service - fast remote file copy program daemonLoaded: loaded (/usr/lib/systemd/system/rsyncd.service; disabled; vendor preset: disabled)Active: active (running) since Fri 2025-07-25 00:29:16 CST; 13s agoMain PID: 5350 (rsync)CGroup: /system.slice/rsyncd.service└─5350 /usr/bin/rsync --daemon --no-detachJul 25 00:29:16 01c systemd[1]: Started fast remote file copy program daemon.#查看進程狀態
[root@01c/my_test]# netstat -tunlp | grep rsync
tcp        0      0 0.0.0.0:873             0.0.0.0:*               LISTEN      5350/rsync          
tcp6       0      0 :::873                  :::*                    LISTEN      5350/rsync          
[root@01c/my_test]# ps -ef |grep rsync
root       5350      1  0 00:29 ?        00:00:00 /usr/bin/rsync --daemon --no-detach
root       5375   1265  0 00:33 pts/0    00:00:00 grep --color=auto rsync

三、Rsync客戶端

交互式客戶端向服務端傳輸備份

# 客戶端需要備份的文件或目錄 服務端預留登陸的賬號@服務端IP::服務端備份配置模塊名
[root@02c/test_file]# rsync -avzP /test_file/233.txt  rsync_backup@192.168.195.189::backup
Password: 
sending incremental file list
233.txt0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=0/1)sent 90 bytes  received 43 bytes  29.56 bytes/sec
total size is 0  speedup is 0.00

可用于腳本的客戶端向服務端傳輸備份

#在客戶端創建密碼文件
[root@02c/test_file]# vim /etc/my_rsync.pwd
[root@02c/test_file]# cat  /etc/my_rsync.pwd
zxcvbn#權限改為600
[root@02c/test_file]# chmod 600 /etc/my_rsync.pwd#腳本中省略傳輸過程和進度   --password-file指定客戶端密碼文件 客戶端需要備份的文件 在服務端data模塊進行傳輸
[root@02c/test_file]# rsync -az --password-file=/etc/my_rsync.pwd  /test_file/233.txt  rsync_backup@192.168.195.189::data
[root@02c/test_file]# #服務端的/data目錄中已經成功備份
[root@01c/my_test]# ll /data/
total 0
-rw-r--r-- 1 work_rsyncd work_rsyncd 0 Jul 23 16:18 233.txt
#先定義密碼變量
[root@02c/test_file]# export RSYNC_PASSWORD='zxcvbn'#客戶端需要備份文件 向服務端data模塊傳輸
[root@02c/test_file]# rsync -avzP /test_file/test_012_get.txt  rsync_backup@192.168.195.189::data
sending incremental file list
test_012_get.txt0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=0/1)sent 99 bytes  received 43 bytes  284.00 bytes/sec
total size is 0  speedup is 0.00#取消密碼變量或者重啟客戶端,密碼變量失效需要重新定義
[root@02c/test_file]# unset RSYNC_PASSWORD

下載服務端的備份到客戶端?

#獲取服務端data模塊內容 到客戶端/test_file/目錄下
[root@02c/test_file]# rsync -avzP rsync_backup@192.168.195.189::data /test_file/
Password: 
receiving incremental file list
./
233.txt0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=1/3)
test_012_get.txt0 100%    0.00kB/s    0:00:00 (xfr#2, to-chk=0/3)sent 69 bytes  received 216 bytes  81.43 bytes/sec
total size is 0  speedup is 0.00
#指定密碼文件  從服務端backup模塊下載備份到 客戶端
[root@02c/test_file]# rsync -az --password-file=/etc/my_rsync.pwd rsync_backup@192.168.195.189::backup /test_file/
[root@02c/test_file]# ll
total 0
-rw-r--r-- 1 root root 0 Jul 23 16:18 233.txt
-rw-r--r-- 1 root root 0 Jul 25 01:14 626.txt
-rw-r--r-- 1 root root 0 Jul 23 16:12 test_012_get.txt

四、Rsync排錯

服務端

1.檢査rsync服務端的配置文件路徑是否正確:/etc/rsyncd.conf

2.查看配置文件的 host allow,host deny 允許的ip網段是否允許客戶端訪問

3.查看配置文件中的path參數路徑是否存在,權限是否正確(和配置文件的UUID參數對應)

4.查看rsync服務是否啟動,端口、進程是否存活

5.查看iptables防火墻、selinux是否允許rsync服務通過,或是關閉

6.查看服務端rsync配置文件的密碼文件,權限是否600,格式,語法是否正確,且和配置文件的 secrect files 參數對應

7.如果是推送數據,要査看配置rsyncd.conf中的用戶對該 rsync模塊 下的文件是否可以讀取

客戶端

1.查看rsync客戶端配置的密碼文件權限是否600,密碼文件格式是否正確,是否和服務端的密碼一致(客戶端密碼文件里只寫密碼,不寫賬戶)

2.嘗試teInet連接rsync服務端的 873 端口,檢測服務是否可以連接

3.客戶端執行命令語法要仔細檢查

五、服務端和客戶端的備份腳本

#在backup目錄下創建備份目錄 命名格式:主機名 主機IP (用/分割后取第一部分,即刪掉/24部分)當前年月日
[root@01c/]# mkdir  /backup/$(hostname)_$(ip a show ens33|awk 'NR==3{print $2}'|cut -d'/' -f1)_$(date "+%F")#將etc和log目錄打包備份在/backup目錄下
#被打包文件不用絕對路徑,盡量用相對路徑
[root@01c/backup]# cd / && tar -zcf /backup/01c_192.168.195.189_2025-07-25/etc.tgz  etc
[root@01c/]# cd / && tar -zcf /backup/01c_192.168.195.189_2025-07-25/log.tgz  var/log/[root@01c/]# ll /backup/
total 0
drwxr-xr-x 2 root root 36 Jul 25 14:19 01c_192.168.195.189_2025-07-25[root@01c/]# ll /backup/01c_192.168.195.189_2025-07-25/
total 10812
-rw-r--r-- 1 root root 10313617 Jul 25 14:19 etc.tgz
-rw-r--r-- 1 root root   755637 Jul 25 14:19 log.tgz

客戶端備份腳本?

#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/binmkdir -p /backup/$(hostname)_$(ip a show ens33|awk 'NR==3{print $2}'|cut -d'/' -f1)_$(date "+%F")cd / && tar -zcf /backup/$(hostname)_$(ip a show ens33|awk 'NR==3{print $2}'|cut -d'/' -f1)_$(date "+%F")/etc.tgz etccd / && tar -zcf /backup/$(hostname)_$(ip a show ens33|awk 'NR==3{print $2}'|cut -d'/' -f1)_$(date "+%F")/log.tgz var/logmd5sum /backup/$(hostname)_$(ip a show ens33|awk 'NR==3{print $2}'|cut -d'/' -f1)_$(date "+%F")/*.tgz > /backup/$(hostname)_$(ip a show ens33|awk 'NR==3{print $2}'|cut -d'/' -f1)_$(date "+%F")/all_data_md5.txt   #對數據進行校驗,生成校驗文件export RSYNC_PASSWORD=zxcvbn  #定義密碼變量rsync -az /backup/  rsync_backup@192.168.195.189::backupfind /backup -type f -mtime +7 -delete  #找到超過7天的備份刪除,節約資源

客戶端向服務端備份腳本測試?

[root@02c~]# bash -x 02c_client.sh 
+ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
++ hostname
++ ip a show ens33
++ awk 'NR==3{print $2}'
++ cut -d/ -f1
++ date +%F
+ mkdir -p /backup/02c_192.168.195.123_2025-07-25
+ cd /
++ hostname
++ awk 'NR==3{print $2}'
++ cut -d/ -f1
++ ip a show ens33
++ date +%F
+ tar -zcf /backup/02c_192.168.195.123_2025-07-25/etc.tgz etc
+ cd /
++ hostname
++ ip a show ens33
++ awk 'NR==3{print $2}'
++ cut -d/ -f1
++ date +%F
+ tar -zcf /backup/02c_192.168.195.123_2025-07-25/log.tgz var/log
++ hostname
++ ip a show ens33
++ awk 'NR==3{print $2}'
++ cut -d/ -f1
++ date +%F
+ md5sum /backup/02c_192.168.195.123_2025-07-25/etc.tgz /backup/02c_192.168.195.123_2025-07-25/log.tgz
++ hostname
++ ip a show ens33
++ awk 'NR==3{print $2}'
++ cut -d/ -f1
++ date +%F
+ export RSYNC_PASSWORD=zxcvbn
+ RSYNC_PASSWORD=zxcvbn
+ rsync -az /backup/ rsync_backup@192.168.195.189::backup
+ find /backup -type f -mtime +7 -delete
#創建定時任務
[root@02c~]# crontab -e
crontab: installing new crontab#每天分鐘執行一次腳本
[root@02c~]# crontab -l
* * * * * /usr/sbin/ntpdate time1.aliyun.com >> /dev/null 2>&1
* * * * * /bin/bash 02c_client.sh#成功備份
[root@01c/backup]# ll
total 0
drwxr-xr-x 2 work_rsyncd work_rsyncd 36 Jul 25 17:34 02c_192.168.195.12[root@02c/backup]# ll
total 0
drwxr-xr-x 2 root root 36 Jul 25 17:34 02c_192.168.195.123_2025-07-2
[root@02c/backup]# #校驗通過
[root@01c/backup]# md5sum -c /backup/02c_192.168.195.123_2025-07-25/all_data_md5.txt 
/backup/02c_192.168.195.123_2025-07-25/etc.tgz: OK
/backup/02c_192.168.195.123_2025-07-25/log.tgz: OK

備份完成發送郵箱

郵箱配置

[root@01c/]# vim /mail.rc set from=xxxxxxxx@163.com                    # 發件人地址
set smtp=smtps://smtp.163.com                # SMTP服務器(SSL加密)
set smtp-auth-userxxxxxxx@163.com            # 認證用戶名
set smtp-auth-password=xxxxxxxxxxx           # 認證密碼
set smtp-auth=login                          # 認證方式
set ssl-verify=ignore                        # 忽略SSL證書驗證
set nss-config-dir=/etc/pki/nssdb/           # NSS證書數據庫路徑

發送校驗結果到指定郵箱?

[root@01c/]# md5sum -c /backup/02c_192.168.195.123_2025-07-25/all_data_md5.txt 
/backup/02c_192.168.195.123_2025-07-25/etc.tgz: OK
/backup/02c_192.168.195.123_2025-07-25/log.tgz: OK#將校驗結果寫進check_md5_result.txt文件里
[root@01c/]# md5sum -c /backup/02c_192.168.195.123_2025-07-25/all_data_md5.txt >/backup/02c_192.168.195.123_2025-07-25/check_md5_result.txt#郵件命名為 check-rsync-年月日   將備份的校驗結果發送到運維郵箱里 
[root@01c/]# mail -s "check-rsync-$(date +%F)" xxxxxxxx@163.com <  /backup/02c_192.168.195.123_2025-07-25/check_md5_result.txt 

?服務端校驗和郵箱腳本

[root@01c~]# vim check_md5.sh#!/bin/bash#對備份文件校驗保存校驗結果
md5sum -c /backup/02c_192.168.195.123_$(date +%F)/all_data_md5.txt >/backup/02c_192.168.195.123_$(date +%F)/check_md5_result.txt#將結果發送到郵箱
mail -s "check-rsync-$(date +%F)" xxxxx@163.com <  /backup/02c_192.168.195.123_$(date +%F)/check_md5_result.txt #刪除超過30天的備份
find /backup -type f -mtime +30 -delete
#創建定時任務 每月5號運行一次腳本
[root@01c~]# crontab -l
* * * * * /usr/sbin/ntpdate time1.aliyun.com >> /dev/null 2>&1
* * 5 * * /bin/bash check_m5d.sh

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/916401.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/916401.shtml
英文地址,請注明出處:http://en.pswp.cn/news/916401.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

以 “有機” 重構增長:云集從電商平臺到健康生活社區的躍遷

當電商行業陷入流量爭奪的紅海&#xff0c;同質化運營模式難以突破增長瓶頸時&#xff0c;云集以從精選電商到有機生活平臺的戰略轉型&#xff0c;開辟出差異化發展路徑。其轉型并非憑經驗決斷的孤例&#xff0c;而是建立在對市場趨勢的精準研判、用戶需求的深度解碼&#xff0…

【2025最新版】midjourney小白零基礎入門到精通教程!人工智能繪圖+AI繪圖+AI畫圖,一鍵出圖教程 (持續更新)

前言 現在市面上相關的AI繪畫工具非常多&#xff0c;有6pen.art、Stable Diffusion、DALL.E、Midjourney等。 而MJ就目前而言&#xff0c;它是一款強大的人工智能工具&#xff0c;旨在幫助設計師和創意人員完成各種設計任務。 非常適合我們圖像工作者&#xff0c;從 UI 設計到…

2025年滲透測試面試題總結-2025年HW(護網面試) 70(題目+回答)

安全領域各種資源&#xff0c;學習文檔&#xff0c;以及工具分享、前沿信息分享、POC、EXP分享。不定期分享各種好玩的項目及好用的工具&#xff0c;歡迎關注。 目錄 2025年HW(護網面試) 70 一、自我介紹 二、同源策略 & 三大漏洞對比解析 1. 同源策略&#xff08;SOP&…

加權卡爾曼濾波

加權卡爾曼濾波融合&#xff0c;它通過給不同傳感器或估計結果分配不同的權重&#xff0c;來提高狀態估計的精度和可靠性。一、卡爾曼濾波1.狀態方程2.觀測方程其中&#xff1a;基本方程①狀態一步預測②狀態估計③濾波增益④一步預測均方差⑤估計均方誤差二、加權卡爾曼濾波對…

【世紀龍科技】新能源汽車維護與故障診斷-汽車專業數字課程資源

在職業院校汽車專業教學中&#xff0c;理論與實踐脫節、設備投入不足、學生實操能力薄弱等問題長期存在。如何讓學生在有限的教學資源下掌握新能源汽車核心技術&#xff1f;如何讓教師更高效地開展理實一體化教學&#xff1f;《新能源汽車維護與故障診斷》數字課程資源&#xf…

Windows Server系統安裝JDK,一直卡在“應用程序正在為首次使用作準備,請稍候”

一、背景 第二次遇到這個問題了&#xff0c;但是居然沒想起來之前遇到過&#xff0c;又問元寶給的答案不對&#xff0c;還沒想起來之前收藏過解決方案&#xff0c;這里特別記錄一下。 二、問題描述 操作系統是Windows Sever2019&#xff0c;安裝JDK時卡住一直過不去&#xff0…

機器學習入門:線性回歸詳解與實戰

線性回歸&#xff08;Linear Regression&#xff09;是機器學習中最基礎也最常用的算法之一&#xff0c;無論是初學者入門還是實際業務場景&#xff0c;都能看到它的身影。本文將從概念、原理到代碼實現&#xff0c;帶你全方位了解線性回歸。一、什么是線性回歸&#xff1f;簡單…

第3篇:軟鏈接 mklink /D 教程:輕量緩存目錄遷移利器

我們通過諸多實踐后將三種鏈接方案分別獨立成篇&#xff0c;可以讓不同需求場景的讀者精準獲取所需內容。下面是回顧我們文章系列策劃的三篇博客標題、定位和詳細大綱&#xff0c;每篇都圍繞一個核心方案展開&#xff0c;具備教學性、實用性和實操性&#xff1a; &#x1f4d8;…

力扣 hot100 Day52

124. 二叉樹中的最大路徑和 二叉樹中的 路徑 被定義為一條節點序列&#xff0c;序列中每對相鄰節點之間都存在一條邊。同一個節點在一條路徑序列中 至多出現一次 。該路徑 至少包含一個 節點&#xff0c;且不一定經過根節點。 路徑和 是路徑中各節點值的總和。 給你一個二叉…

數據存儲:OLAP vs OLTP

下面系統性地進行介紹,包括OLAP數據庫的基本概念、特點、常見產品,以及它們在實際工作中的典型應用場景,最后對比與關系型數據庫(OLTP)的區別。 一、OLAP數據庫是什么? OLAP(Online Analytical Processing,聯機分析處理)數據庫,主要用于大數據量、多維度、復雜查詢與…

云原生網絡策略自動化在微服務架構 API 安全防護與流量管理中的應用

云原生網絡策略自動化在微服務架構中的核心價值隨著微服務架構在金融、電商等領域的廣泛應用&#xff0c;API安全防護與流量管理已成為企業數字化轉型的關鍵挑戰。Gartner 2023年報告顯示&#xff0c;83%的分布式系統因網絡策略缺失導致安全事件&#xff0c;而傳統靜態策略配置…

無需云服務器的內網穿透方案 -- cloudflare tunnel

內網穿透 原文地址 https://docs.caolib.dpdns.org/network/cloudflare tunnel.html Cloudflare Tunnel 內網穿透工具 1.簡介 1.1 介紹 官方介紹&#xff1a;Cloudflare Tunnel 為您提供了一種安全的方式&#xff0c;無需公開路由的 IP 地址即可將資源連接到 Cloudflare。使用…

目前市面上arm64-v8a、armeabi-v7a設備的市占率有多少?為什么x86架構的手機越來越少?

deepseek回答&#xff1a; 當前全球范圍內&#xff0c;arm64-v8a 架構在安卓設備中的市占率已超過 64%&#xff0c;遠超其他架構版本。具體分布如下&#xff1a; &#x1f4ca; 各架構市場份額對比 架構類型市占率定位與趨勢arm64-v8a≥64%主流 64 位架構&#xff0c;性能最…

Java中配置兩個r2db連接不同的數據庫

Java中配置兩個r2db連接不同的數據庫在實際項目中不可避免的存在使用兩個數據庫的情況&#xff0c;下面將系統地講解相關配置方案&#xff0c;包含配置文件、數據庫配置類、注解原理、常見錯誤排查等維度&#x1f9e9; 一、配置文件說明&#xff08;application.yml&#xff09…

Swagger 配置及使用指南

Spring Boot 項目集成 Swagger 配置及使用指南 一、Swagger 簡介 Swagger 是一個用于設計、構建、文檔化和使用 RESTful API 的框架。通過集成 Swagger&#xff0c;開發者可以&#xff1a; 自動生成實時 API 文檔直接在瀏覽器中測試 API 接口減少手動編寫文檔的工作量支持團隊協…

什么是緩存雪崩?緩存擊穿?緩存穿透?分別如何解決?什么是緩存預熱?

緩存雪崩&#xff1a;在一個時間段內&#xff0c;有大量的key過期&#xff0c;或者Redis服務宕機&#xff0c;導致大量的請求到達數據庫,帶來巨大壓力- 給key設置不同的TTL、利用Redis集群提高服務的高可用性、添加多級緩存、添加降級流策略緩存擊穿&#xff1a;給某一個key設置…

圖像預處理 二

目錄 1. 插值方法 1.1 最近鄰插值 1.2 雙線性插值 1.3 像素區域插值 1.4 雙三次插值 1.5 Lanczos插值 1.6 小結 2. 圖像掩膜 2.1 制作掩膜 2.2 與運算 2.3 顏色替換 2.3.1 制作掩膜 2.3.2 顏色替換 2.4 圖像掩膜代碼 3. 圖像添加水印 3.1 模板輸入 3.2 與運算 3…

1.Java發展簡史與設計哲學

目錄引言一、生活里到處都是 Java1.1 Java 在生活中的小例子1.2 Java 的核心應用場景二、Java 是咋誕生的&#xff0c;又有啥核心設計思想2.1 Java 的發展歷程2.2 Java 的三大設計哲學2.3 Java 哲學給行業帶來的變革三、為啥大家都選 Java 呢3.1 和其他主流編程語言對比的優勢3…

基于粒子群算法優化高斯過程回歸(PSO-GPR)的多輸出回歸

基于粒子群算法優化高斯過程回歸(PSO-GPR)的多輸出回歸 使用粒子群優化算法(PSO)優化高斯過程回歸(GPR)模型,解決多輸入多輸出(MIMO)回歸問題。該模型能夠同時預測多個相關輸出變量。 %% 基于粒子群算法優化高斯過程回歸(PSO-GPR)的多輸出回歸 % 作者: MATLAB技術助手 % 日期…

學Simulink——AC-DC整流器場景:基于PWM整流器拓撲結構的建模:三相電壓型PWM整流器(SR)單位功率因數控制仿真

目錄 手把手教你學Simulink——AC-DC整流器場景:基于PWM整流器拓撲結構的建模:三相電壓型PWM整流器(SR)單位功率因數控制仿真 一、背景介紹 二、系統結構設計 三、建模過程詳解 第一步:創建新Simulink項目 第二步:添加主要模塊 1. 三相交流電源 2. PWM整流器電路 …