Persistent snapshots can continuously grow, potentially impacting system performance and stability. This script helps prevent such issues by providing regular reports, making it easier to identify and clean up old or unnecessary snapshots.
- Monitor snapshot usage in Proxmox environments
- Automatically receive snapshot reports via email to avoid manual checks
- Detect old or orphaned snapshots that should be cleaned up
- Audit snapshot descriptions and creation dates for compliance and management
- Prevent uncontrolled snapshot growth by providing regular reports and reminders for cleanup
Choose one of the following methods to install the script on your Proxmox host:
- Download the
proxmox_snapshot_report.sh
file from GitHub (e.g., using your browser). - Copy the file to
/usr/local/bin/
:cp /path/to/proxmox_snapshot_report.sh /usr/local/bin/proxmox_snapshot_report.sh
- Download the script directly:
wget https://github.com/filipnet/proxmox-snapshot-report/raw/main/proxmox_snapshot_report.sh -O /usr/local/bin/proxmox_snapshot_report.sh
- Install
git
if not already present:apt update && apt install git
- Clone the repository:
git clone https://github.com/filipnet/proxmox-snapshot-report.git
- Copy the script to
/usr/local/bin/
:cp proxmox-snapshot-report/proxmox_snapshot_report.sh /usr/local/bin/proxmox_snapshot_report.sh
Make the script executable:
chmod +x /usr/local/bin/proxmox_snapshot_report.sh
To update the script, replace the file with the latest version.
⚠️ Note: Before updating, back up your configuration variables—either save them separately or rename the existing script.
All configuration variables are located at the beginning of the script:
REPORT_EMAIL
: Recipient address for the reportMIN_SNAPSHOT_AGE_DAYS
: Minimum age (in days) of snapshots to includeINCLUDE_VM_SNAPSHOTS
: "true" or "false" (as a string), whether to include VM snapshotsINCLUDE_LXC_SNAPSHOTS
: "true" or "false" (as a string), whether to include LXC snapshotsMAIL_SUBJECT
: Subject line of the report emailENABLE_LOGGING
: Enables console log output ("true"/"false" as a string, not 1/0)
To run the script manually, enter the following command on your Proxmox host:
/usr/local/bin/proxmox_snapshot_report.sh
The output will appear directly in the terminal. The script generates the snapshot report and sends it via email if configured.
root@pve:~# crontab -e
no crontab for root - using an empty one
Select an editor. To change later, run 'select-editor'.
1. /bin/nano <---- easiest
2. /usr/bin/vim.basic
3. /usr/bin/vim.tiny
Choose 1-3 [1]: 1
For example, add the following line to receive the report every Monday at 7:00 AM:
0 7 * * 1 /usr/local/bin/proxmox_snapshot_report.sh > /dev/null 2>&1
Save the file. The cronjob will now run the script automatically at the specified time and send the report via email.
Note: Make sure that email sending is properly configured on your Proxmox host so that reports can be delivered.
Below is an example of the script's output as seen on the command line when executed manually:
root@pve:~# ./proxmox_snapshot_report.sh
[INFO] Creating snapshot report at /tmp/pve_snapshot_report.txt
[INFO] Scanning VM snapshots...
[INFO] Processing VM 112
[INFO] Processing VM 114
[INFO] Processing VM 113
[INFO] Scanning LXC snapshots via pct...
[INFO] Processing LXC 102
[INFO] Processing LXC 103
[INFO] Processing LXC 107
[INFO] Processing LXC 108
[INFO] Processing LXC 111
[INFO] Processing LXC 121
[INFO] Sending report to admin@example.tld
Type VMID Snapshot Name Snapshot Date Description
LXC 111 Test 2025-07-05 07:52 This is a test for the notification script
VM 112 backup1 2025-07-07 22:30 Weekly backup before update
The script requires root privileges because it accesses all VMs and containers. Review the code before use and only run it on trusted systems.
⚠️ Note: Use this script at your own risk. The authors and contributors are not responsible for any damage, data loss, or issues resulting from its use. Always test scripts in a safe environment before deploying them in production.
Contributions and improvements are welcome. Please submit pull requests or open issues for feature requests and bug reports.
This project is licensed under the BSD 3-Clause License. See the LICENSE for details.