I have a game server. It auto-gets players’ screenshots and stores at /home/gameserver/serverfiles/screenshots.
I want to delete old screenshots when it reaches 1000. I mean if it’s 1000 screenshots, when a new screenshot comes, it auto-deletes the 1000th screenshot.
How can I do that, which scripts can I use? Can anyone give suggestion or codes?
Note: I am using Ubuntu 18.04 and my game server user hasn't sudo access.
I want to maintain my screenshot folder to hold max 1000 images.