Lab Building Race 19 backup log file

Source: Internet
Author: User

The requirements for log backups are described below:
To add a scheduled task to a Shiyanlou user
Pack/var/log dpkg.log,mysql.log,fontconfig.log three files to/home/shiyanlou/backup/directory every day 2 o'clock in the morning
The name format is year-month-day. Tar, for example today is October 23, 2017, then the file name is 2017-10-23.tar, and if there is a duplicate, overwrite

The first step
I searched the internet first. How to use time to name

$ (date +%y-%d-%m). Tar

Step Two
To add a scheduled task to a Shiyanlou user

 

Step Three
Add a task

0 2 * * * tar-zcf/home/shiyanlou/backup/$ (date +%y-%d-%m). Tar/var/log/dpkg.log/var/log/mysql.log/var/log/fontconfig. Log

Submitted by

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.