Sample Header Ad - 728x90

Remove temporary files from disk caused by Redis command BGREWRITEAOF

0 votes
1 answer
1915 views
Context description --- My Linux distribution contains redis-server 6.0.5. Redis is configured to use persistence AOF (Append Only File) and the RDB persistence is disabled ([Redis persistence](https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/)) . At boot a script requests to redis-server the execution of BGREWRITEAOF command. This request starts a process (with PID=`) which creates a file temp-rewriteaof-.aof in the same data Redis path where is written the appendonly.aof` file. This is the normal working of BGREWRITEAOF command. The usefulness of this command is proved by what it's written in [this post](https://unix.stackexchange.com/questions/721321/why-does-the-redis-server-take-too-long-to-load-in-memory-the-database-at-boot) . What's the problem --- The problem comes when the system is switch off while the BGREWRITEAOF is not completed. In this case the file temp-rewriteaof-.aof is still present at reboot and it takes up space on the disk. Because the system can be switch off in every moment I risk that my disk can become full. In my opinion, the unique solution for this problem is to create a script that remove all files temp-rewriteaof-*.aof from the data Redis folder. Question --- Does someone know a better solution? Redis has got a **clean** procedure/command for solve this problem?
Asked by User051209 (498 rep)
Oct 28, 2022, 02:34 PM
Last activity: Feb 21, 2025, 09:59 AM