Depending on your server OS of choice you can create a batch file or create a <a href="https://code.tutsplus.com/tutorials/scheduling-tasks-with-cron-jobs--net-8800" target="_blank" rel="noopener noreferrer">Cron job</a> to automate the commands.