A Windows script to create Cloudflare configuration backups using curl.
- Create a folder for your backups
- Download the batch file to the new folder
- Updated the batch file as required (*)
- Browse to the backup folder
- Double-click the batch file
- Open the command prompt
- Navigate to the backup folder
- Execute the script
- The folder name convention will be
- Backup root (where you drop the script)
- Backup root\Domain
- Backup root\Domain\YYYY-MM-DD HH:MM:SS
- Backup root\account (for Load Balancer Pools)
- Backup root\Domain
- Backup root (where you drop the script)
- This is not a full backup, as most account settings are not being copied
- This script was tested with Free and Pro zones in the same account
- Find the following items to replace:
- [REPLACE WITH YOUR CLOUDFLARE LOGIN EMAIL]: Enter your Cloudflare login email
- [REPLACE WITH YOUR API KEY]: Enter an API key with Read rights to all zones
- For each Zone you want to create a backup for:
- Update the line ZoneID#, Domain#
- The sample script has nine zones ZoneID1 ... ZoneID9 and corresponding Domain1 ... Domain9
- You can remove pairs if you have less than nine zones
- You can add pairs if you have more than nine zones, remembering to name the pair correctly with the sequential numbers
- If you add or remove pairs, adjust the "for /L %%i in (1,1,9) do (" statement replacing 9 with the correct number of pairs
- [REPLACE WITH ZONE ID TO BACKUP]: Enter the Zone ID
- [REPLACE WITH DOMAIN NAME FOR THIS ZONE]: Enter the domain name to be used as a sub-folder
- Update the line ZoneID#, Domain#
- Load Balancer pools are copied from account, so these need to be manually updated, with the correct Load Balance Pool
- If you don't use Load Balancers you can remove the commands between the comments :: Backup account level data and :: End Backup account level data