cleansedbb
Technical User
I want to make a script that will be called by cron that will rotate a log file daily. this isnt a normal log file it's a html file so I want to archive it by date.
log.html should become ddmmyyyy.log
i've tried to define the format with printf but no luck.
command substitution: line1: syntax error near unexpected token 'printf('%02d%02d%04d',('
command substitution: line1: 'printf('%02d%02d%04d',('$Month$Day$Year))'
this is what I have
logfile=$(printf('%02d%02d%04d',($Month $Day $Year)))
log.html should become ddmmyyyy.log
i've tried to define the format with printf but no luck.
command substitution: line1: syntax error near unexpected token 'printf('%02d%02d%04d',('
command substitution: line1: 'printf('%02d%02d%04d',('$Month$Day$Year))'
this is what I have
logfile=$(printf('%02d%02d%04d',($Month $Day $Year)))