Skip to content

Instantly share code, notes, and snippets.

@orange888
Forked from jarvisluong/upload_to_pcloud.sh
Created October 24, 2019 19:38
Show Gist options
  • Save orange888/dd921ca44faa238d33c94e4a53aa32aa to your computer and use it in GitHub Desktop.
Save orange888/dd921ca44faa238d33c94e4a53aa32aa to your computer and use it in GitHub Desktop.
Upload file to Pcloud via Rest API
#!/bin/bash
while :
do
zip -r $ZIP_FILENAME $FOLDERNAME && curl -F 'filename=@$ZIP_FILENAME' 'https://api.pcloud.com/uploadtolink?code=$PCLOUD_UPLOAD_CODE' && rm -f $ZIP_FILENAME && sleep $SLEEPTIME
done
#ZIP_FILENAME: file name of the zip you want to name it
#FOLDERNAME: the folder you want to zip
#PCLOUD_UPLOAD_CODE: go to pcloud, generate an upload link, you will find the code
#SLEEPTIME: the sleep interval for each upload cycle, if you want this to be a loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment