Search for unknown scripts within the filesystem.
Search for unknown scripts within the filesystem.
Hey there, welcome to the forum! This is my debut post—I hope it lands in the right spot. I’m dealing with a puzzling issue on my Ubuntu server. The disk space keeps getting low because MySQL 8 is performing daily full backups without deleting old ones. I set this up a few years ago (around 2017), but I’m not sure where the backup files are stored or how it’s all configured. I remember the SQL dumps go to /etc/backups/mysql, and the backups run every morning at 3 AM. There’s also a log file at /etc/backups/mysql/mysql-backup.log, but it doesn’t show the source of the logs. A typical log entry looks like this:
```
=== Start of Backup 20220117_030001 ===
# MySQL dump started
```
But I’m still confused about the exact path and how to locate the backup script. Any tips would be greatly appreciated!
I previously used the database for several game servers (CS, Garry's Mod, Minecraft, etc.), but those services are now offline and I’m not aware of any backup options. I’ll examine this more closely today—it could be the reason. There’s also a custom Spring Boot application on the server that handles the actual data, yet there’s no built-in backup system, which would have prompted me to create it myself recently.
Consider searching the filesystem with tools like find or grep. You might locate the required script by matching paths such as "/etc/backups/mysql" or "/etc/backups/mysql/mysql-backup.log". This approach could help since the script needs to reference backup locations. For more guidance, you can refer to examples on Stack Overflow.
I attempted to look through the entire file system for /etc/backups/mysql today. My SSH connection ended after three hours, which stopped the search. I expect it may be better to divide the task into several runs for different folders. If the path is added dynamically in the script or passed through environment variables, I might have a chance. I’ll try this again soon. Appreciate the suggestion!
I wasn’t able to locate the backup script on my server, even after a complete system scan for that file location. I set up a cron job to remove backups older than seven days, which addresses the symptom of space issues but doesn’t resolve the underlying problem. The command `find /var/backups/mysql -type d -ctime +7 -exec rm -rf {} \;` was executed successfully. Thanks for your patience!
I understand you already have a working approach, but to address this I’d: examine who owns the log and backup files. It’s likely the account managing the script is the one handling them. Look at timestamps in the files or logs—if they’re consistent, log in during normal hours and use `sudo ps aux | grep username` to identify the process. If you no longer need MySQL, you can safely stop and disable the service since it won’t be used for backups.