#!/bin/bash set -euo pipefail if [[ "$(id -u)" -ne 0 ]]; then echo "需要 root" exit 1 fi dir="$(cd "$(dirname "$0")" && pwd)" cat > /etc/cron.d/gsfdc-backup <> ${dir}/backup.log 2>&1 EOF chmod 644 /etc/cron.d/gsfdc-backup echo "已安装每天 03:15 的数据库备份"