You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
# -------------------------- 数据导入定时任务(每日执行) --------------------------
|
|
|
|
|
|
# MySQL:每日凌晨3点导入前一天的交易数据(假设CSV文件每日凌晨2点生成)
|
|
|
|
|
|
0 3 * * * /opt/stock_scripts/load_data_mysql.sh >> /var/log/stock_data_import.log 2>&1
|
|
|
|
|
|
|
|
|
|
|
|
# PostgreSQL:每日凌晨3点10分导入(错开MySQL执行时间,避免数据库压力)
|
|
|
|
|
|
10 3 * * * /opt/stock_scripts/copy_data_pg.sh >> /var/log/stock_data_import_pg.log 2>&1
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------------- 分表扩展定时任务(每月执行) --------------------------
|
|
|
|
|
|
# MySQL:每月最后一天凌晨2点创建下一个月分区
|
|
|
|
|
|
0 2 L * * /opt/stock_scripts/auto_add_mysql_partition.sh >> /var/log/auto_add_mysql_partition.log 2>&1
|
|
|
|
|
|
|
|
|
|
|
|
# PostgreSQL:每月最后一天凌晨2点10分创建下一个月子表
|
|
|
|
|
|
10 2 L * * /opt/stock_scripts/auto_add_pg_subtable.sh >> /var/log/auto_add_pg_subtable.log 2>&1
|