Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

About the backup of massive data tables collected by archive engine

Shulou Source: shulou.com Published: 2022-06-03 05:48:04 11月24日 Update

Back up table data by ID interval every day

#! / bin/bash

Date-d yesterday + "DATE Y-%m-%d H:%M:%S" > > / Mysql_Data/t_collection/ID.log

/ usr/bin/mysql-uroot-- password= "admin"-D userbehavior-e "select max (ID) from tasking;" | grep-v 'max (ID)' > > / Mysql_Data/t_collection/ID.log

Today= `tail-n 1 / Mysql_Data/t_collection/ ID. Log`

Yesterday= `tail-n 3 / Mysql_Data/t_collection/ID.log | grep-v 'DATE' | grep-v $today`

Sql= "use userbehavior;\ n

Select * from t_collection where ID > $yesterday and ID3899999999 and ID

Tags: Backup data interval sub-table data backup program script engine data table mass Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi vpn NVidia Shulou Information macOS