InfraGuard

Backup script builder

Prefill a skeleton from the target, finish the script yourself, then switch it on to run on schedule.

Overview — what it does

The Script Builder generates and guides a backup script so an SE can understand, review and place it in crontab. It generalizes the legacy mysqldump auto-generation + report callback.

How to use

  1. Define a job (infr_backup_job): target service · kind (db/web/custom) · schedule · storage target.
  2. Generate a script from a template + job params → infr_generated_script (body + crontab line).
# mysqldump with credentials hidden via --defaults-extra-file (never on the CLI)
mysqldump --defaults-extra-file=/etc/infr/{ident}.cnf --routines --opt --events \
  {db} {tables} -h{host} > {target}/{ident}_$(date +%Y%m%d%H%M).sql
  1. Place the script on the target host and register the crontab line (the app does not write remote crontab).

Schedule grammar "N U" — U ∈ M(minute) / H(hour) / D(day) / W(week), e.g. 6 H. next_run_at = start_at + interval, via App\Support\ScheduleGrammar.

Data sources

Access

Read/write level≥2.

Related

Where the script builder starts
Where the script builder starts