I have a Cron that is running that at script that backs up data is passing in variables to the backup and create script i need to know how to take the log file im passing and add to the
CRON:
BACKUP=DEV /usr/local/bin/backup.sh > /var/log/backup-`date "+\%m\%d\%y"`.log 2>&1||/usr/local/bin/create-ticket.sh
in script create-ticket.sh i have the following:
#create Ticket for failed backup#
JIRA=`/opt/atlassian-cli/jira.sh --server
https://blahblah --user admin --password blahblah --action createIssue --project "DEV" --type "Incident" --summary "Failed backup on $BACKUP" --components "blah" --priority "Major"| awk '{print $2}'`
###Atttach logs:###
/opt/atlassian-cli/jira.sh --server
https://blahblah --user admin --password blahblah --action addAttachment --issue "${JIRA}" --file "?????"
I Need to know how to get the file name of this cron output "/var/log/backup-`date "+\%m\%d\%y"`.log" in to the section (--file "????")
i know i can do a Variable=/var/log/backup-`date "+\%m\%d\%y"`.log & pass in $Variable but i don't want to do that.
any help would be appreciated.