Ok, the new version of Linux and Solaris supports date with the "--date="7 days ago" command and that's fine. But this is just on the latest platforms. I'm trying now with HP-UX and they have still no support for this.
Well yes there is the old way with perl like :
perl -e 'use POSIX;print strftime "%Y%m%d\n",localtime time-604800;'
but i would like to keep my scripts small and easy. Involving perl opens up to a lot of other problems.
My script must run as cron and on many different servers so I want to keep the commands to a minimum.
No comments:
Post a Comment