• Home
    • English
    • 中文
  • About Us
  • Services
    • SEO Services
    • Website Design Service
  • Projects
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Contact Us

Subscribe to Updates

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

What's Hot

Design a plugin for wordpress woocommerce to display a tab to show attachment download

2024-04-06

TranslatePress v2.6.9 – WordPress Translation Plugin

2023-12-25

A Linux batch script converting pictures to webp format

2023-07-10
Facebook Twitter Instagram
  • 中文
  • English
Facebook Twitter Instagram Pinterest VKontakte
Weilai Tech Weilai Tech
  • Home
    • English
    • 中文
  • About Us
  • Services
    • SEO Services
    • Website Design Service
  • Projects
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Contact Us
Weilai Tech Weilai Tech
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

A Linux batch script converting pictures to webp format

2023-07-10

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
Recent Posts
  • Design a plugin for wordpress woocommerce to display a tab to show attachment download
  • TranslatePress v2.6.9 – WordPress Translation Plugin
  • A Linux batch script converting pictures to webp format
  • Hearing aid listed company official website SEO case
  • how to use docker to run php5.6 plus apache
March 2019
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Feb   Apr »
Tags
app branding design digital Docly docs etc faq fix github Helpdesk Image issue magento Manual marketing memecached Photography planing seo sequrity tips Travel ui/ux web WordPress 爬虫
Editors Picks
About Us

Guangzhou Weilai Technology is a foreign trade integrated marketing service provider focusing on Google as the drainage center and marketing self-built website as the carrier.

Email Us: [email protected]
Contact: +86 18676917505

Facebook Pinterest YouTube LinkedIn
Recent Posts
  • Design a plugin for wordpress woocommerce to display a tab to show attachment download
  • TranslatePress v2.6.9 – WordPress Translation Plugin
  • A Linux batch script converting pictures to webp format
  • Hearing aid listed company official website SEO case
  • how to use docker to run php5.6 plus apache
From Flickr
Website Design Case
© 2024 Copyright by Guangzhou Weilai Technology Co.,Ltd..
  • Home
  • About Us
  • SEO Services
  • Website Design Service
  • Projects
  • Blog
  • Contact Us

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