码迷,mamicode.com
首页 > 其他好文 > 详细

test

时间:2018-07-29 11:54:59      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:long   backup   bin   home   message   hat   script   ESS   tin   

sfsfs

lsjfslfjs

#!/bin/bash
####################################
#
# Backup to NFS mount script.
#
####################################
# What to backup. 
backup_files="/home /var/spool/mail /etc /root /boot /opt"

# Where to backup to.
dest="/mnt/backup"

# Create archive filename.
day=$(date +%A)
hostname=$(hostname -s)
archive_file="$hostname-$day.tgz"

# Print start status message.
echo "Backing up $backup_files to $dest/$archive_file"
date
echo

# Backup the files using tar.
tar czf $dest/$archive_file $backup_files
# Print end status message.
echo
echo "Backup finished"
date

# Long listing of files in $dest to check file sizes.
ls -lh $dest

test

标签:long   backup   bin   home   message   hat   script   ESS   tin   

原文地址:https://www.cnblogs.com/fcing/p/9384441.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!