Re: uploading a file
Date: Fri, 25 Sep 2020 10:32:29 -0600
On 2020-09-25, at 07:58:55, mehran j via curl-users <curl-users_at_cool.haxx.se> wrote:
> In a shell scrip.
> a=`date '+%y%m%d'`;export a
> 2. Then script that runs creates the new test.csv file
> 3. mv /directory/test.csv /directory/test_$a.csv
> 4. curl --user user:password -T '/user/directory1/test_$a.csv' 'https://webcloud/directory1/directory2/'
> 5. mv yesterday's test_date.csv file onto processed directory.
> The CURL bit is not working unless it like curl --user user:password -T '/user/directory1/test_20200925.csv' 'https://webcloud/directory1/directory2/'
> ie: exact name for the csv file like test_20200925.csv rather than test_$a.csv
I'll revise my suggestion:
set -x # Keep a log (but where does it go?)
a=`date '+%y%m%d'`;export a # looks good.
# Then use quotation marks instead of apostrophes:
curl --user user:password -T "/user/directory1/test_$a.csv" 'https://webcloud/directory1/directory2/'