• Home
    • Cool Knowledge base
    • Light Knowledge base
    • Help Desk
    • OnePage Documentation
  • Services
    • Main Services
    • PPC Services
    • SEO Services
    • SMM Services
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Forum
    • Forums
    • Forum Topics
    • Topic Details
    • Ask Question
  • Pages
  • Contact

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

VideoJS – multiple source demo

2022-03-08

Add custom field to Woocommerce tab

2022-03-07

Surror Product Tabs for WooCommerce

2022-03-07
Facebook Twitter Instagram
  • 中文
  • English
Facebook Twitter Instagram Pinterest VKontakte
SEO & Website build tips SEO & Website build tips
  • Home
    • Cool Knowledge base
    • Light Knowledge base
    • Help Desk
    • OnePage Documentation
  • Services
    • Main Services
    • PPC Services
    • SEO Services
    • SMM Services
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Forum
    • Forums
    • Forum Topics
    • Topic Details
    • Ask Question
  • Pages
  • Contact
SEO & Website build tips SEO & Website build tips
Home»linux»Centos»aliyun auto mysql and file backup to oss
Centos

aliyun auto mysql and file backup to oss

OxfordBy Oxford2019-03-12No Comments1 Min Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Share
Facebook Twitter LinkedIn Pinterest Email
//autorun

crontab -e

02 4 * * * root run-parts /etc/cron.daily
42 4 1 * * root run-parts /etc/cron.monthly
// mysqlbackup 

vi  /etc/cron.daily/bakmysql.sh


DATE=`date +%Y%m%d%H%M` #every minute
DATABASE=wordpress_hss5com #database name
DB_USER=wordpress #database username
DB_PASS="wordpress" #database password
BACKUP=/data/dbbackup #backup path

#backup command

/usr/bin/mysqldump -u$DB_USER -p$DB_PASS -h 127.0.0.1 -R --opt $DATABASE |gzip > ${BACKUP}\/${DATABASE}_${DATE}.sql.gz

# send to oss 

/var/local/src/ossutil64 cp /data/dbbackup/ oss://vpseo.com/dbbackup -r -u



#just backup the latest 5 days

find ${BACKUP} -name "${DATABASE}_*.sql.gz" -type f -mtime +50 -exec rm {} \; > /dev/null 2>&1

 

vi  /etc/cron.monthly/bakfile.sh

// file backup

DATE=`date +%Y%m%d%H%M` #every minute

WEBSITE=hss5com

BACKUP=/data/filebackup #backup path

#backup command

zip -r ${BACKUP}\/${WEBSITE}_${DATE}_file.zip /var/www/html/*
#zip -r ${BACKUP}\/host2.${WEBSITE}_${DATE}_file.zip /var/www/html/host2/*

/var/local/src/ossutil64 cp /data/filebackup/ oss://hss5com/filebackup -r -u

#just backup the latest 365 days

find ${BACKUP} -name "${WEBSITE}_*.zip" -type f -mtime +365 -exec rm {} \; > /dev/null 2>&1


 

mysql 每日自动备份, 文件每月自动备份 到 阿里云oss

config ossutil64 tool for oss upload/download

Aliyun – OSS工具ossutil使用简介

 

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Avatar photo
Oxford

Related Posts

How to Install Windows Nano Server on ESXi

2021-06-22

How To Install vSphere ESXi 7.0 on Bare-metal Servers

2021-06-18

mysql8 my.ini config file for 2g memory

2021-05-21

Keep Your SSH Session Running when You Disconnect

2020-11-25
Recent Posts
  • VideoJS – multiple source demo
  • Add custom field to Woocommerce tab
  • Surror Product Tabs for WooCommerce
  • How To Scrape Amazon at Scale With Python Scrapy, And Never Get Banned
  • Compile a Jekyll project without installing Jekyll or Ruby by using Docker
March 2019
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Feb   Apr »
Tags
app branding culture design digital Docly docs etc faq fashion featured fitness fix github Helpdesk Image issue leisure lifestyle magento Manual marketing memecached Photography picks planing seo sequrity tips Travel trending ui/ux web WordPress 爬虫
Editors Picks

Fujifilm’s 102-Megapixel Camera is the Size of a Typical DSLR

2021-01-05
Top Reviews
8.9

Which LED Lights for Nail Salon Safe? Comparison of Major Brands

By Oxford
8.9

Review: Xiaomi’s New Loudspeakers for Hi-fi and Home Cinema Systems

By Oxford
70

CES 2021 Highlights: 79 Top Photos, Products, and Much More

By Oxford
Advertisement
Demo
  • Facebook
  • Twitter
  • Instagram
  • Pinterest
About Us
About Us

Your source for the lifestyle news. This demo is crafted specifically to exhibit the use of the theme as a lifestyle site. Visit our main page for more demos.

We're accepting new partnerships right now.

Email Us: [email protected]
Contact: +1-320-0123-451

Facebook Twitter Instagram Pinterest YouTube LinkedIn
Recent Posts
  • VideoJS – multiple source demo
  • Add custom field to Woocommerce tab
  • Surror Product Tabs for WooCommerce
  • How To Scrape Amazon at Scale With Python Scrapy, And Never Get Banned
  • Compile a Jekyll project without installing Jekyll or Ruby by using Docker
From Flickr
Ascend
terns
casual
riders on the storm
chairman
mood
monument
liquid cancer
blue
basement
ditch
stars
© 2025 Designed by 九号资源网.

Type above and press Enter to search. Press Esc to cancel.