box / boxcli

A command line interface for interacting with the Box API.
https://developer.box.com
Apache License 2.0
229 stars 59 forks source link

Issue with uploading a file using cli. #308

Closed bconroy1 closed 2 years ago

bconroy1 commented 2 years ago

Hi,

I have a cron job that runs once a week which runs a psql query, outputs a file, gzips it, and uploads the file to box.

For some reason I am getting an empty file out there first, then when it tries to upload the "real" file it fails because a file exists with that name.

Has anyone seen that before, I know I don't have any other box uploads happening.

I am kinda doing a hacky work around that if I see that file existing I'll delete it before the real upload which may or may not even work because I don't know why the file is there in the first place.

Any help would be greatly appreciated.

thanks

bob


!/bin/bash

today="$(date '+%Y-%m-%d')"

/home/bob/.nvm/versions/node/v12.13.0/bin/box configure:environments:add /home/bob/the-jobs/box_config/config.json

psql ..... (creates the csv file)

sleep 10

gzip $HOME/the-jobs/output/the-report-${today}.csv

sleep 10

/home/bob/.nvm/versions/node/v12.13.0/bin/box files:upload $HOME/the-jobs/output/the-report-${today}.csv.gz --parent-id 999999999

echo 'done'


arjankowski commented 2 years ago

Hi @bemeric1 ,

Unfortunately I was unable to reproduce your issue. Have you tried to upload this *.gz file from pure console without any script and cron job? Plese just run this command with

/home/bob/.nvm/versions/node/v12.13.0/bin/box files:upload $HOME/the-jobs/output/the-report-2022-04-20.csv.gz --parent-id 999999999

Is the final result is the same?

@arjankowski

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

stale[bot] commented 2 years ago

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box CLI and feel free to open another PR/issue at any time.