I am creating a script that moves all 'logA' files in a certain folder and adds timestamp every 3 hours, afterwards it will be zipped.
This is the base of the script:
cd /logs mv *logA+timestamp /backupDIR cd /backupDIR
--then the GZIP part--
Since it will run every 3 hours, there will be a time there are already .gzip files in the /backupDIR. Sample:
logA.07132020-16.00.gz logA.07132020-19.00.gz logA.07132020-22.00.gz logA.07142020-02.00
How can I exclude the already zipped file in the script? Should I do loop that will check if there are still .logA+timestamp?