This system automates the backup of WordPress site code from the Hostinger VPS to the Gaia-Digital-Agency GitHub Organization.
- Scans
/home: Iterates through all user directories. - Filters Targets: Only processes directories containing a
public_htmlfolder. - Skips Exceptions: Bypasses system folders (
virtfs,lscache) and massive sites that cause timeouts (aperitif). - Resets Git: Deletes existing
.gitfolders to ensure a clean, "source of truth" push from the server to GitHub. - Aggressive Ignoring: Uses a specialized
.gitignoreto skip:- Media/Images (
wp-content/uploads/,img/) - Cache/Upgrades (
wp-content/cache/) - Massive Logs (
error_log) - Large Archives (
.zip,.tar.gz,.sql)
- Media/Images (
- Auto-Repo Creation: Uses
gh clito automatically create private repositories if they don't exist. - SSH Authentication: Uses the specific
id_ed25519_gaiakey for all transactions.
To run the full backup of all standard sites:
/root/backup_to_github.sh