in reply to Mysql backup using DateTime

I don't know much about running remote commands, but the date part can be done using:

use DateTime qw( ); my $date = DateTime ->today( time_zone => 'local' ) ->strftime( '%Y-%m-%d' );

or just

use POSIX qw( strftime ); my $date = strftime( '%Y-%m-%d', localtime );

Well, that's assuming the date is the date on which the cron job is run. Is it something else?