Upload files from the Server with a shell script to the BunnyCDN API #61
ChristopherDosin
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Upload media files via the BunnyCDN API
To be able to upload large amounts of media files it's recommended to use the BunnyCDN API.
Also
scp
takes quite some time, so it might speed up the uploading process.Here's a simple shell script that you can execute:
Shell script
Create an
bunnycdn.sh
with the following content:After you've saved the
bunnycdn.sh
give the file the permissions to execute it withchmod +x bunnycdn.sh
.Last but not least: Execute the file with
./bunnycdn.sh
and watch how your files are uploaded fast.Running the script in the background using nohup
You may want to run the script in the background if your connection get's interrupted for example.
nohup: Stands for "no hang up." This command runs your script in the background and ignores any hangup signals.
Do to do just execute the following command:
nohup.out
in the same directory, unless the output is redirected elsewhere.&
at the end puts the job in the background.You can close the terminal or disconnect, and the script will keep running.
Watch progress
If you want to watch the progress of the upload, you may use
tail -f
to watch the output:This command will display the end of the
nohup.out
file and update in real-time as more output is written to it.Beta Was this translation helpful? Give feedback.
All reactions