When running scripts/new/homer_mysql_rotate.pl it wasn't picking up the argument for the ini location, the argv array element referenced was just off, so I changed from 1 to 0.
Also, I had it figure out the dir it's working from and use that as a default, but...
Additionally, when running from cron without the argument, it was looking for rotation.ini locally, but it didn't have working dir context, so it would fail to load it. So I added a little logic to have it figure out what dir the script is working in and reference the absolute path. I just used bashes dirname for the special $0 value in perl. I think that Perl had a Cwd module which will figure out the absolute path, but, my perl is a tiny bit rusty. Feel free to update that if you're more of a perl guru than I.
When running
scripts/new/homer_mysql_rotate.pl
it wasn't picking up the argument for the ini location, the argv array element referenced was just off, so I changed from 1 to 0.Also, I had it figure out the dir it's working from and use that as a default, but...
Additionally, when running from cron without the argument, it was looking for
rotation.ini
locally, but it didn't have working dir context, so it would fail to load it. So I added a little logic to have it figure out what dir the script is working in and reference the absolute path. I just used bashesdirname
for the special$0
value in perl. I think that Perl had aCwd
module which will figure out the absolute path, but, my perl is a tiny bit rusty. Feel free to update that if you're more of a perl guru than I.