20170721l08-02-02 old boy Linux Ops training elementary eighth class before the "on-machine combat" exam explained

Source: Internet
Author: User
Tags rsync

It's mainly about rsync.

On-Machine experiment

and write some scripts.

Here is the script for automatic backup


#bak Site and logs

cd/var/html && tar zcf/backup/www_$ (date +%f). tar.gz./www

Cd/app && tar zcf/backup/logs_$ (date +%f). tar.gz./logs


#bak SYS conf

CD/&& tar zcf/backup/etc_$ (date +%f). tar.gz./scripts

/bin/cp/var/spool/cron/root/backup/


#rsync data to Bakserver

Rsync-avzp/backup/rsync [Email protected]::backup/--password-file=/etc/

Rsync.password


#del data 7 days ago

Find/backup-type f-name "*.tar.gz"-mtime +7|xargs rm-f


The above script is still an unfinished version

20170721l08-02-02 old boy Linux Ops training elementary eighth class before the "on-machine combat" exam explained

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.