vim /root/bin/backup.sh
方法一:
!/bin/bash
echo "正在备份...."
cp -a /etc /root/etcdate +%F
echo "备份完成"
方法二:计划任务
!/bin/bash
crontab -e
1 0 * cp -a /etc /root/etcdate +%F
vim /root/bin/backup.sh
方法一:
echo "正在备份...."
cp -a /etc /root/etcdate +%F
echo "备份完成"
方法二:计划任务
crontab -e
1 0 * cp -a /etc /root/etcdate +%F