I’m trying to backup my minecraft server whenever I start it, so I’d like you help me with command that checks if in the backups folder there is X amount of old backups and if there is less than X backups than save current files, and otherwise delete oldest backup and save the current files as the newest. So, before I execute java -jar server.jar command I’d like the computer to take backup of my server and then start the server.
Note: I’m executing the server from .sh file
I checked that you can check the number of files in the working directory by “ls | wc -l” but I don’t know the syntax of bash language and I don’t wanna learn it from scratch.
diedassel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.