Keeping regular backups of your pfSense configuration is very important. In this guide, I’ll show you how to automatically back up pfSense to Google Drive using Rclone on Ubuntu/Linux.
Step 1: Install Rclone
Run the following command to install Rclone:
Step 2: Configure Rclone for Google Drive
Start the configuration:
Follow these options:
-
Press n for a new remote.
-
Give it a name (e.g.,
gdrive). -
Choose
drivefor Google Drive. -
Leave
client_idandclient_secretblank. -
For scope, choose
1(full access). -
Leave
root_folder_idandservice_account_fileblank. -
Press n for “Edit advanced config”.
-
Press y for “Use auto config” (a browser will open).
-
Log in with your Google account and allow access.
-
Back in the terminal, confirm settings.
-
Press q to quit.
Step 3: Create Backup Script
Create a script file, for example:
Paste the script below (update with your own pfSense details):
Make the script executable:
Step 4: Automate with Cron
You can schedule automatic backups with cron.
For the current user:
Or for the whole system:
Add this line to run backup daily at 2 AM:
