I have a file called 'log.txt' that I would like to move to the logs folder on a nightly basis.
The problem is that I want to keep track of the files so I would actually need to move it to a log1.txt, log2.txt, log3.txt and so on.
Is there a unix command or a bash script way to do this?
G-Man
You want to look at a tool called logrotate. You probably already have this installed due to other tools using it for exactly this purpose. It involves you writing a small config file and it will deal with rotating your logfile and restarting any process that has the file open.