The File=esp - $Now. SQL
SevenDays=$(date - d - 1 day + "H % Y % m % d % % m % S")
If [-f/opt/itrus esp_backold/esp - $SevenDays. SQL]
Then
Rm - rf/opt/itrus/esp_backold/esp - $SevenDays. SQL
Echo "You have the delete 1 days line bak file"
The else
Echo "1 days line bak file not exist", "
Fi
Get SevenDays value, and then according to the value under the corresponding path to delete the previous file, has been deleted (file exists), after some problems appeared in SevenDays, but I don't know what the reason, which a great god knows!
CodePudding user response:
You take time is (date) (month) (year) hours, minutes seconds, you can make sure the file name on the correspondingCodePudding user response:
Esp - 20190721101725. This is to generate the SQL file name before test after remove the minutes when also can'tCodePudding user response: