当前位置:网站首页>Shell script - backup, update and rollback of files
Shell script - backup, update and rollback of files
2022-07-27 01:43:00 【A simple comparison】
List of articles
Shell Script —— Backup of files , Update and rollback
Script
#!/bin/bash
read -p " Please enter the absolute path of the directory you want to backup to :" a
# Both functions and variables are OK here , It can also be done without
beifen () {
rsync -arv /mnt/1.txt $a
}
gengxin () {
rsync -auvr -delete /mnt/1.txt $a
}
huigun () {
rm -rf /mnt/1.txt
cp -rfp $a/1txt /mnt
}
read -p " Please enter the action you want to perform (A: Backup 、B: to update 、C: Roll back ):" b
case $b in
A)
beifen
;;
B)
gengxin
;;
C)
huigun
;;
*)
echo "no"
exit
esac
perform

END
边栏推荐
猜你喜欢
随机推荐
8、 Definition of array
Create a daemon
34iptables防火墙
Makefile
Typescript 14 starting from 0: built in tool type
Web Service (04) -- Introduction and construction of lamp +discuz Forum
Vector容器的底层实现
12、 Regular expression
33 three swordsman awk
iptables
小项目——开机自连校园网
CDC only supports PostgreSQL database to version 12? Is there any plan to support version 14? Does anyone know?
Suggestions for beginners of MySQL (strongly recommended ~ don't regret ~ ~)
Lamp+discuz Forum
RT-thread学习
【CANN训练营】走进媒体数据处理(下)
Shell(8)循环
System safety and Application
散户股票开户哪个证券公司好,哪个更安全
Ubuntu12.10安装Mysql5.5(二)
![[SQL injection] extended injection method](/img/a1/d4218281bfc83a080970d8591cc6d4.png)


![[ctf real question] 2018 WANGDING cup web unfinish](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)




![[by pass] bypass method of WAF](/img/dd/7204b2401a9f18c02c8b9897258905.png)