how to check date is older than x days in shell script
datetime='2016-08-31T15:38:18Z'
timeago='90 days ago'
dtSec=$(date --date "$datetime" +'%s')
taSec=$(date --date "$timeago" +'%s')
echo "INFO: dtSec=$dtSec, taSec=$taSec" >&2
[ $dtSec -lt $taSec ] && echo too old
Also in Shell:
- unir arquivos linux
- powershell script enable tls 1.2
- kill all python processes ubuntu
- julia install linux
- how to tar linux
- git push pull asks for login everytime
- date linux show millis
- set origin url git
- npm install package globally
- exit from jshell
- pytesseract
- install faiss in colab
- grep search for text in php files recursive
- linux command line in windows 10
- bash grep and sort
- ubuntu command line replace word in files
- composer install ubuntu
- ssh github generate key
- how to install node fetch
- install axios vue
- upgrade yarn version
- uninstall webpack globally
- git ignore
- how to create a branch in git