After the linux File is uploaded, the system automatically sends an email to shell. First, the function of each directory is described as www.2cto.com # backup file storage directory/home/admin/xiaoshibak # all shell storage directories/home/admin/xiaoshi # automatic upload + automatic shell/home/admin/xiaoshi/run. sh # automatically upload the file shell (the FTP command cannot upload the Directory)/home/admin/xiaoshi/wwwrootbak. sh # automatically send an email to shell/home/admin/xiaoshi/mail. sh # shell Content/home/admin/xiaoshi/mail.txt www.2cto.com/home/admin/xiaoshi/run. shsh/home/admin/xiaoshi/wwwrootbak. shsh/home/admin/xiaoshi/mail. sh/home /Admin/xiaoshi/wwwrootbak. sh #! /Bin/bash ftp-n your FTP Host IP <END user FTP account FTP password binary cd/LCD/home/admin/xiaoshibak prompt mput *. *#*. * Indicates the meaning of uploading any file in this directory: exit bye/home/admin/xiaoshi/mail. sh mailx-s "File Uploaded" 123456@qq.com Choose one of the above four commands .. run the following command after packaging www.2cto.com: nohup/home/admin/xiaoshi/run. after the sh & command is executed, the file will be automatically uploaded, and then you can exit SSH. After all the files are uploaded, you will receive an email prompt. If your server cannot execute the mailx command or use the mailx command cannot send mail, please refer to the following article http://www.bkjia.com/ OS /201209/156623.html
Address: http://www.cnblogs.com/xiaoshi1991/archive/2012/09/20/2695645.html