Simple Bash Script that gets date
I have a program on our server called "ExpireQuarantine" and I would like to make it much more automated. The command I need to run is:
Quote:
|
Quote:
Post what you've written already, and where you're getting stuck, and we can help. But I doubt anyone here is going to write your script for you. |
All I'm trying to figure out is how I can get the date 6 months ago in the format of: "YYYY-MM-DD"
Anything after that I'm already with doing. |
You should start with "man date". GNU date has some convenient options. In particular, you may want to look at the --date option and the DATE STRING section of the manual. Note that it accepts relative dates and numbers as well as free-form dates. Experiment with different ways of specifying what you want it to do. You may be surprised at how easy it is to get what you want.
As for how it formats the output, have a look at the quick help displayed with "date --help". |
All times are GMT -5. The time now is 05:36 AM. |