I Have a bash .sh script and I am trying to zip up yesterday's log and archive in a AWS Bucket. I need some help with getting the format of the file name correct but not having luck with it. Here is the script:
#!/bin/bash
/jobs/copytS3.sh /var/log/appname_log_"date" --date="yesterday" +'%Y%m%d'.log
Output shows following:
zip warning: name not matched: /var/log/appname_log_date
Not sure what I am missing. The name of the file should be: appname_log_20210120.log.
I am sure it's something very basic, but I'm unable to resolve. Appreciate any help with the syntax. Thanks!