Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS system backup script sharing

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "CentOS system backup script sharing". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "CentOS system backup script sharing"!

#!/ bin/sh

#Set variables

bak_path=/root/bak_linux

date=$(date +%Y%m%d)

log_file=$bak_path/$date#log.log

#Write the results to the log

exec 1>>$log_file 2>&1

#Package the directory to be backed up into the $bak_path directory

tar -zcvf $bak_path/$date#boot.tar.gz /boot

tar -zcvf $bak_path/$date#etc.tar.gz /etc

tar -zcvf $bak_path/$date#var.tar.gz /var

echo "############\n"

echo $?

#Upload backup files

ftp -i -n -v

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report