#! /Bin/sh # set the variable bak_path =/root/bak_linuxdate = $ (date + % Y % m % d) log_file = $ bak_path/$ date # log. log # write the execution result to the log: exec1 & gt; $ log_file2 & gt; & amp; 1 # package the directory to be backed up in the tar-zcvf $ bak_path/paths directory under $ bak_path #! /Bin/sh
# Set variables
Bak_path =/root/bak_linux
Date = $ (date + % Y % m % d)
Log_file = $ bak_path/$ date # log. log
# Write the execution result to the log
Exec 1> $ log_file 2> & 1
# Package the directory to be backed up in the $ bak_path directory.
Tar-zcvf $ bak_path/logs/boot
Tar-zcvf $ bak_path/Tables/etc
Tar-zcvf $ bak_path/Tables/var
Echo "############ \ n"
Echo $?
# Uploading backup files
Ftp-I-n-v <FTPIT
Open 192.168.0.27
User 111 111
Binary
LCD $ bak_path
Mput * .tar.gz
Put * # log. log
By
FTPIT
Echo "############ \ n"
Echo $?
Delete the uploaded .tar and. log files.
Rm-rf $ bak_path/* # *. tar
Rm-rf $ bak_path/* # log. log