Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ##
- ## Initial and continous ZFS filesystems replication
- ##
- PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
- if [ ! `whoami` = "root" ]; then
- echo "You need to be root."
- exit
- fi
- l_old="@local_replicate.base"
- r_old="@remote_replicate.base"
- l_new="@local_replicate.delta"
- r_new="@remote_replicate.delta"
- log="/var/log/replicate.log"
- cmd=$(mktemp /tmp/replicate.job.XXXXXX)
- pid="/var/run/replicate.pid"
- path="/usr/local/etc/replicatejobs/"
- jobs=`find $path -type f ! -iname sample_* ! -iname noauto_* | sort -d`
- ##
- ## Mail settings
- ##
- subject="A replication error has occurred!"
- address=""
- mail=$(mktemp /tmp/replicate.mail.XXXXXX)
- usage()
- {
- echo ""
- echo "Usage: `basename $0` [Options] [Flags] [Job]"
- echo ""
- echo "Options: -c|-h"
- echo "-c: Clean."
- echo " removes replicated filesystems and snapshot(s)."
- echo "-h: Usage."
- echo ""
- echo "Flags: auto"
- echo "auto: Clean auto."
- echo " removes all scheduled snapshot(s)."
- echo ""
- echo "Examples: `basename $0` | `basename $0` jobname"
- echo " `basename $0` -c | `basename $0` -c jobname | `basename $0` -c auto"
- echo ""
- }
- l_base()
- {
- ##
- ## Makes local baseline replication
- ##
- if zpool status `echo $lfs | cut -f1 -d /` | grep "scan:" | egrep -qo "(scrub in progress|resilver in progress)"; then
- echo "`date`: A Scrub or Resilver is currently in progress on source pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- elif zpool status $lp | grep "scan:" | egrep -qo "(scrub in progress|resilver in progress)"; then
- echo "`date`: A Scrub or Resilver is currently in progress on destination pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- fi
- echo "echo \"\`date\`: Beginning local baseline replication sequence on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- # Take initial snapshot(s):
- echo "sudo zfs snapshot $lfs$l_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Initial snapshot(s) created\" >> $log" >> ${cmd}
- # Replicate data:
- echo "sudo zfs send $lfs$l_old | sudo zfs recv -Fd $lp 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Data replicated\" >> $log" >> ${cmd}
- echo "echo \"\`date\`: Local baseline replication sequence finished on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- echo "" >> ${cmd}
- echo "" >> $log
- }
- r_base()
- {
- ##
- ## Makes remote baseline replication
- ##
- if [ `ping -c 1 -W 1000 $rh | grep -oe "[0-9] packets received" | awk '{print $1}'` -eq "0" ]; then
- echo "`date`: Remote baseline replication sequence aborted on \"$lfs\"! No response from \"$rh\"." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- fi
- if zpool status `echo $lfs | cut -f1 -d /` | grep "scan:" | egrep -qo "(scrub in progress|resilver in progress)"; then
- echo "`date`: A Scrub or Resilver is currently in progress on source pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- elif su replicator -c "ssh $rh zpool status $rp | grep \"scan:\" | egrep -qo '(scrub in progress|resilver in progress)'"; then
- echo "`date`: A Scrub or Resilver is currently in progress on remote pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- fi
- echo "echo \"\`date\`: Beginning remote baseline replication sequence on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- # Take initial snapshot(s):
- echo "sudo zfs snapshot $lfs$r_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Initial snapshot(s) created\" >> $log" >> ${cmd}
- # Replicate data:
- echo "sudo zfs send $lfs$r_old | ssh $rh sudo zfs recv -dF $rp/$lh 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Data replicated\" >> $log" >> ${cmd}
- echo "echo \"\`date\`: Remote baseline replication sequence finished on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- echo "" >> ${cmd}
- echo "" >> $log
- }
- l_inc()
- {
- ##
- ## Makes local incremental replication
- ##
- if zpool status `echo $lfs | cut -f1 -d /` | grep "scan:" | egrep -qo "(scrub in progress|resilver in progress)"; then
- echo "`date`: A Scrub or Resilver is currently in progress on source pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- elif zpool status $lp | grep "scan:" | egrep -qo "(scrub in progress|resilver in progress)"; then
- echo "`date`: A Scrub or Resilver is currently in progress on destination pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- fi
- tfs=`echo $lfs | cut -f 2-512 -d / | sed "s/^/$lp\//"`
- echo "echo \"\`date\`: Beginning local incremental replication sequence on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- # Take new source snapshot(s):
- echo "sudo zfs snapshot $lfs$l_new 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: New snapshot(s) created\" >> $log" >> ${cmd}
- # Replicate data:
- echo "sudo zfs send -i $lfs$l_old $lfs$l_new | sudo zfs recv -Fd $lp 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Data replicated\" >> $log" >> ${cmd}
- # Destroy target .old snapshot(s):
- echo "sudo zfs destroy $tfs$l_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Target .base snapshot(s) destroyed\" >> $log" >> ${cmd}
- # Rename target .new snapshot(s) .old:
- echo "sudo zfs rename $tfs$l_new $tfs$l_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Target .delta snapshot(s) renamed .base\" >> $log" >> ${cmd}
- # Destroy source .old snapshot(s):
- echo "sudo zfs destroy $lfs$l_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Source .base snapshot(s) destroyed\" >> $log" >> ${cmd}
- # Rename source .new snapshot(s) .old:
- echo "sudo zfs rename $lfs$l_new $lfs$l_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Source .delta snapshot(s) renamed .base\" >> $log" >> ${cmd}
- echo "echo \"\`date\`: Local incremental replication sequence finished on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- echo "" >> ${cmd}
- echo "" >> $log
- }
- r_inc()
- {
- ##
- ## Makes remote incremental replication
- ##
- if [ `ping -c 1 -W 1000 $rh | grep -oe "[0-9] packets received" | awk '{print $1}'` -eq "0" ]; then
- echo "`date`: Remote incremental replication sequence aborted on \"$lfs\"! No response from \"$rh\"." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- fi
- if zpool status `echo $lfs | cut -f1 -d /` | grep "scan:" | egrep -qo "(scrub in progress|resilver in progress)"; then
- echo "`date`: A Scrub or Resilver is currently in progress on source pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- elif su replicator -c "ssh $rh zpool status $rp | grep \"scan:\" | egrep -qo '(scrub in progress|resilver in progress)'"; then
- echo "`date`: A Scrub or Resilver is currently in progress on remote pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- fi
- tfs=`echo $lfs | cut -f 2-512 -d / | sed "s/^/$rp\/$lh\//"`
- echo "echo \"\`date\`: Beginning remote incremental replication sequence on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- # Take new source snapshot(s):
- echo "sudo zfs snapshot $lfs$r_new 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: New snapshot(s) created\" >> $log" >> ${cmd}
- # Replicate data:
- echo "sudo zfs send -i $lfs$r_old $lfs$r_new | ssh $rh sudo zfs recv -dF $rp/$lh 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Data replicated\" >> $log" >> ${cmd}
- # Destroy target .old snapshot(s):
- echo "ssh $rh sudo zfs destroy $tfs$r_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Target .base snapshot(s) destroyed\" >> $log" >> ${cmd}
- # Rename target .new snapshot(s) .old:
- echo "ssh $rh sudo zfs rename $tfs$r_new $tfs$r_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Target .delta snapshot(s) renamed .base\" >> $log" >> ${cmd}
- # Destroy source .old snapshot(s):
- echo "sudo zfs destroy $lfs$r_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Source .base snapshot(s) destroyed\" >> $log" >> ${cmd}
- # Rename source .new snapshot(s) .old:
- echo "sudo zfs rename $lfs$r_new $lfs$r_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Source .delta snapshot(s) renamed .base\" >> $log" >> ${cmd}
- echo "echo \"\`date\`: Remote incremental replication sequence finished on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- echo "" >> ${cmd}
- echo "" >> $log
- }
- l_clean()
- {
- ##
- ## Cleans locally replicated file system
- ##
- if zpool status `echo $lfs | cut -f1 -d /` | grep "scan:" | egrep -qo "(scrub in progress|resilver in progress)"; then
- echo "`date`: A Scrub or Resilver is currently in progress on source pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- elif zpool status $lp | grep "scan:" | egrep -qo "(scrub in progress|resilver in progress)"; then
- echo "`date`: A Scrub or Resilver is currently in progress on destination pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- fi
- tfs=`echo $lfs | cut -f 2-512 -d / | sed "s/^/$lp\//"`
- echo "echo \"\`date\`: Beginning local cleaning process on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- if [ `zfs list -t snapshot | grep $lfs$l_old | wc -l` -eq "1" ]; then
- echo "sudo zfs destroy $lfs$l_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Local base snapshot destroyed\" >> $log" >> ${cmd}
- fi
- if [ `zfs list -t snapshot | grep $lfs$l_new | wc -l` -eq "1" ]; then
- echo "sudo zfs destroy $lfs$l_new 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Local delta snapshot destroyed\" >> $log" >> ${cmd}
- fi
- if [ `zfs list -t snapshot | grep $tfs$l_old | wc -l` -eq "1" ]; then
- echo "sudo zfs destroy $tfs$l_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Target base snapshot destroyed\" >> $log" >> ${cmd}
- fi
- if [ `zfs list -t snapshot | grep $tfs$l_new | wc -l` -eq "1" ]; then
- echo "sudo zfs destroy $tfs$l_new 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Target delta snapshot destroyed\" >> $log" >> ${cmd}
- fi
- if [ `zfs list | grep $tfs | wc -l` -gt "0" ]; then
- echo "sudo zfs destroy $tfs 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Target filesystem destroyed\" >> $log" >> ${cmd}
- fi
- echo "echo \"\`date\`: Local cleanup complete on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- echo "" >> ${cmd}
- echo "" >> $log
- }
- r_clean()
- {
- ##
- ## Cleans remotely replicated file systems
- ##
- if [ `ping -c 1 -W 1000 $rh | grep -oe "[0-9] packets received" | awk '{print $1}'` -eq "0" ]; then
- echo "`date`: Remote cleanup aborted on \"$lfs\"! No response from \"$rh\"." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- fi
- if zpool status `echo $lfs | cut -f1 -d /` | grep "scan:" | egrep -qo "(scrub in progress|resilver in progress)"; then
- echo "`date`: A Scrub or Resilver is currently in progress on source pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- elif su replicator -c "ssh $rh zpool status $rp | grep \"scan:\" | egrep -qo '(scrub in progress|resilver in progress)'"; then
- echo "`date`: A Scrub or Resilver is currently in progress on destination pool, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- exit 1
- fi
- tfs=`echo $lfs | cut -f 2-512 -d / | sed "s/^/$rp\/$lh\//"`
- echo "echo \"\`date\`: Beginning remote cleaning process on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- if [ `zfs list -t snapshot | grep $lfs$r_old | wc -l` -eq "1" ]; then
- echo "sudo zfs destroy $lfs$r_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Local base snapshot destroyed\" >> $log" >> ${cmd}
- fi
- if [ `zfs list -t snapshot | grep $lfs$r_new | wc -l` -eq "1" ]; then
- echo "sudo zfs destroy $lfs$r_new 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Local delta snapshot destroyed\" >> $log" >> ${cmd}
- fi
- if [ `su replicator -c "ssh $rh zfs list -t snapshot | grep $tfs$r_old | wc -l"` -eq "1" ]; then
- echo "ssh $rh sudo zfs destroy $tfs$r_old 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Target base snapshot destroyed\" >> $log" >> ${cmd}
- fi
- if [ `su replicator -c "ssh $rh zfs list -t snapshot | grep $tfs$r_new | wc -l"` -eq "1" ]; then
- echo "ssh $rh sudo zfs destroy $tfs$r_new 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Target delta snapshot destroyed\" >> $log" >> ${cmd}
- fi
- if [ `su replicator -c "ssh $rh zfs list | grep $tfs | wc -l"` -gt "0" ]; then
- echo "ssh $rh sudo zfs destroy $tfs 2>> ${cmd}" >> ${cmd}
- echo errorcheck >> ${cmd}
- echo "echo \"\`date\`: Target filesystem destroyed\" >> $log" >> ${cmd}
- fi
- echo "echo \"\`date\`: Remote cleanup complete on \"$lfs\"\" | tee -a /var/log/messages >> $log" >> ${cmd}
- echo "" >> ${cmd}
- echo "" >> $log
- }
- recurse()
- {
- sed -i '' -e 's/zfs snapshot /zfs snapshot -r /' -e 's/zfs send /zfs send -R /' -e 's/zfs destroy /zfs destroy -r /' -e 's/zfs rename /zfs rename -r /' ${cmd}
- }
- sanity()
- {
- if [ -e $pid ]; then
- echo "`date`: Started a new process, but the previous \"replicate\" is still running, aborting." | tee -a /var/log/messages >> $log
- echo "" >> $log
- rm ${cmd}; rm ${mail}; exit 1
- fi
- chown replicator ${mail}; chmod 600 ${mail}
- chown replicator ${cmd}; chmod 700 ${cmd}
- cat > ${cmd} << EOF
- #!/bin/sh
- errorcheck()
- {
- if [ "\$?" -ne "0" ]; then
- tail -2 ${cmd} >> $log
- tail -10 $log > ${mail}
- mail -s "$subject" $address < ${mail}
- cat /dev/null > ${mail}
- exit 1
- fi
- }
- EOF
- }
- autoclean()
- {
- ##
- ## Find and destroy all automatically taken snapshots
- ##
- zfs list -t snapshot -o name | grep auto > ${cmd}
- cat ${cmd}
- sed -i '' 's/^/sudo zfs destroy /' ${cmd}
- }
- allow()
- {
- sudoers="/usr/local/etc/sudoers"
- if [ `grep "ssh" ${cmd} | wc -l` -gt "0" ]
- then
- allows=`grep zfs ${cmd} | cut -f 1 -d ">" | tr '|' '\n' | sed -e 's/^ //' -e 's/ 2$//' | sed -e 's/sudo //' -e 's/^ //' -e 's/^/replicator ALL=(ALL) NOPASSWD: \/sbin\//' | grep -v ssh`
- else
- allows=`grep zfs ${cmd} | cut -f 1 -d ">" | tr '|' '\n' | sed -e 's/^ //' -e 's/ 2$//' | sed -e 's/sudo //' -e 's/^ //' -e 's/^/replicator ALL=(ALL) NOPASSWD: \/sbin\//'`
- fi
- if [ `grep "replicator" $sudoers | wc -l` -gt "0" ]; then
- sed -i '' '/replicator/d' $sudoers
- fi
- echo "$allows" >> $sudoers
- }
- disallow()
- {
- if [ `grep "replicator" $sudoers | wc -l` -gt "0" ]; then
- sed -i '' '/replicator/d' $sudoers
- fi
- }
- ##
- ## Initial preparation
- ##
- chmod 664 /var/log/messages
- case "$1" in
- "")
- ##
- ## If no jobname is specified, it will find all jobs in config directory and
- ## process them one by one
- ##
- for job in $jobs
- do
- sanity
- . $job
- if [ -z "$rh" ]
- then
- if [ `zfs list -t snapshot | grep $lfs$l_old | wc -l` -eq "1" ]
- then
- if [ "$r" = "yes" ]
- then
- l_inc; recurse
- else
- l_inc
- fi
- else
- if [ "$r" = "yes" ]
- then
- l_base; recurse
- else
- l_base
- fi
- fi
- else
- if [ `zfs list -t snapshot | grep $lfs$r_old | wc -l` -eq "1" ]
- then
- if [ "$r" = "yes" ]
- then
- r_inc; recurse
- else
- r_inc
- fi
- else
- if [ "$r" = "yes" ]
- then
- r_base; recurse
- else
- r_base
- fi
- fi
- fi
- touch $pid
- allow
- su replicator -c ${cmd}
- disallow
- rm $pid
- done
- ;;
- -c)
- ##
- ## When cleaning, if no jobname is specified, it will find all jobs in
- ## config directory and process them one by one
- ##
- if [ "$2" = "auto" ]
- then
- else
- echo ""
- echo "Starting off by deleting replication snapshot(s) and cleaning the entire"
- echo "target pool zfs filesystem. This can take a while, depending on how much"
- echo "is stored."
- sleep 10
- fi
- if [ "$2" = "" ]; then
- for job in $jobs
- do
- sanity
- . $job
- if [ -z "$rh" ]
- then
- if [ "$r" = "yes" ]
- then
- l_clean; recurse
- else
- l_clean
- fi
- else
- if [ "$r" = "yes" ]
- then
- r_clean; recurse
- else
- r_clean
- fi
- fi
- touch $pid
- allow
- su replicator -c ${cmd}
- disallow
- rm $pid
- done
- exit
- fi
- ##
- ## Also when cleaning, if you type in shorthand jobname, it will only clean
- ## specified job
- ##
- if [ `ls -1 $path | grep $2 | wc -l` -eq "1" ]; then
- sanity
- . $path$2
- if [ -z "$rh" ]
- then
- if [ "$r" = "yes" ]
- then
- l_clean; recurse
- else
- l_clean
- fi
- else
- if [ "$r" = "yes" ]
- then
- r_clean; recurse
- else
- r_clean
- fi
- fi
- touch $pid
- allow
- su replicator -c ${cmd}
- disallow
- rm $pid
- else
- ##
- ## If you type "auto" when cleaning, it finds and destroys all snapshots with
- ## the word "auto" in them.
- ##
- if [ "$2" = "auto" ]
- then
- sanity
- autoclean
- while true
- do
- read -r -p 'These snapshot(s) will destroyed. Confirm? "Y|n"' choice
- case "$choice" in
- y|Y) touch $pid
- allow
- su replicator -c ${cmd}
- disallow
- rm $pid
- check=`zfs list -t snapshot`
- result="no datasets available"
- if [ "$check" = "$result" ]; then
- echo "Seems clean enough"
- else
- echo "Seems there are snaps left:"
- zfs list -t snapshot
- fi; break ;;
- n|N) echo "Suit yourself..." ; break ;;
- *) echo "Suit yourself..." ; break ;;
- esac
- done
- else
- echo ""
- echo "### Error! ###"
- echo "Jobname \"$2\" does not exist"
- usage
- fi
- fi
- ;;
- -h)
- usage
- ;;
- *)
- ##
- ## If you type in shorthand jobname, it will only process specified job
- ##
- if [ `ls -1 $path | grep $1 | wc -l` -eq "1" ]
- then
- sanity
- . $path$1
- if [ -z "$rh" ]
- then
- if [ `zfs list -t snapshot | grep $lfs$l_old | wc -l` -eq "1" ]
- then
- if [ "$r" = "yes" ]
- then
- l_inc; recurse
- else
- l_inc
- fi
- else
- if [ "$r" = "yes" ]
- then
- l_base; recurse
- else
- l_base
- fi
- fi
- else
- if [ `zfs list -t snapshot | grep $lfs$r_old | wc -l` -eq "1" ]
- then
- if [ "$r" = "yes" ]
- then
- r_inc; recurse
- else
- r_inc
- fi
- else
- if [ "$r" = "yes" ]
- then
- r_base; recurse
- else
- r_base
- fi
- fi
- fi
- touch $pid
- allow
- su replicator -c ${cmd}
- disallow
- rm $pid
- else
- echo ""
- echo "### Error! ###"
- echo "Jobname \"$1\" does not exist"
- usage
- fi
- ;;
- esac
- ##
- ## Final cleanup
- ##
- if [ -e ${cmd} ]; then
- rm ${cmd}
- fi
- if [ -e ${mail} ]; then
- rm ${mail}
- fi
- chmod 644 /var/log/messages
Advertisement
Add Comment
Please, Sign In to add comment