Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ElanHasson/b43d78b99f12bfee066230223465f44a to your computer and use it in GitHub Desktop.
Save ElanHasson/b43d78b99f12bfee066230223465f44a to your computer and use it in GitHub Desktop.
#/bin/bash
bucketname="node-configs"
bucketId=`storj list-buckets | grep "Name: $bucketname" | awk '{ print $2}'`
bucketfiles=`storj list-files "$bucketId"`
for file in *
do
echo $file
bucketFileId=`echo $bucketfiles | grep "Name: $file" | awk '{ print $2}'`
if [ -z "$bucketFileId" ]
then
echo "File not found. Will upload"
else
eval "storj remove-file $bucketId $bucketFileId"
fi
eval "storj upload-file $bucketId $file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment