make a script to upload a folder to mega from my unix shell
- User
make a script to upload a folder to mega from my unix shell
- Assistant
Sure! Here's a script to upload a folder to MEGA from your Unix shell using the
megauploadCLI tool:bash#!/bin/bash MEGA_USERNAME="<your_mega_username>" MEGA_PASSWORD="<your_mega_password>" FOLDER_PATH="<path_to_folder>" # Log in to MEGA mega-login $MEGA_USERNAME $MEGA_PASSWORD # Create a new directory in MEGA mega-mkdir "<destination_folder_name>" # Upload the folder and its contents to MEGA mega-put -r "$FOLDER_PATH" "destination_folder_name" # Log out from MEGA mega-logoutMake sure to replace
<your_mega_username>,<your_mega_password>, and<path_to_folder>with your actual MEGA username, password, and the path to the folder you want to upload, respectively.Save the script with a
.shfile extension (e.g.,upload_to_mega.sh), then give execute permissions to the script using the commandchmod +x upload_to_mega.sh. Finally, run the script with./upload_to_mega.sh. - User
redo the prompt in markdown format
- Assistant
Sure! Here's the script to upload a folder to MEGA from your Unix shell using the
megauploadCLI tool, formatted in Markdown:bash#!/bin/bash MEGA_USERNAME="<your_mega_username>" MEGA_PASSWORD="<your_mega_password>" FOLDER_PATH="<path_to_folder>" # Log in to MEGA mega-login $MEGA_USERNAME $MEGA_PASSWORD # Create a new directory in MEGA mega-mkdir "<destination_folder_name>" # Upload the folder and its contents to MEGA mega-put -r "$FOLDER_PATH" "destination_folder_name" # Log out from MEGA mega-logoutMake sure to replace
<your_mega_username>,<your_mega_password>, and<path_to_folder>with your actual MEGA username, password, and the path to the folder you want to upload, respectively.Save the script with a
.shfile extension (e.g.,upload_to_mega.sh), then give execute permissions to the script using the commandchmod +x upload_to_mega.sh. Finally, run the script with .