We get some postgres db command files (Insert, Update, Create, Drop etc) with the DB commands in them on a location(\usr\DB Scripts) in our Linux environment.
We need to come up with a script, which when ran,
-> creates a consolidated file, with the statements in each file, ended with a GO statement
-> Move the individual files used in the above consolidated file, into an archive directory, with timestamp in the name.
-> Leave any unused files in the original location (\usr\DB Scripts); These will be the files which may have been added just after the script was run
-> Run another script which compiles the consolidated file, against the database.
Can someone kindly help with this? I'm fairly new to the linux world.