Skip to content

Instantly share code, notes, and snippets.

@anarion80
anarion80 / clear_logs
Created April 28, 2024 13:19
Clear OPNsense filter logs when they take too much space
#!/usr/local/bin/bash
# Set the threshold for disk usage (in percentage)
THRESHOLD=70
# Set the directory to monitor
DIRECTORY="/var/log/filter"
# Get the current disk usage percentage
DISK_USAGE=$(df -h "$DIRECTORY" | tail -n 1 | awk '{print $5}' | tr -d '% ')
@anarion80
anarion80 / dell_upload
Created April 28, 2024 13:20
Rclone move files older than 1 day
#!/bin/bash
# Local Drive
# This must be a local mount point on your server that is used for the source of files
# WARNING: If you make this your rclone Google Drive mount, it will create a move loop
# and delete your files!
# Make sure to this to the local path you are moving from!
LOCAL=/mnt/local
DELL=dell:/tank