当前位置:网站首页>Use lightweight application server to automatically download and upload to onedrive
Use lightweight application server to automatically download and upload to onedrive
2022-06-24 03:32:00 【yolk】
programme
aria2 Add onemanger
Buy lightweight application servers
Optional configuration , Select according to the server region of the file to be downloaded . I chose the pagoda here for convenience
Start deployment
1. install aria2
wget -N git.io/aria2.sh && chmod +x aria2.sh && ./aria2.sh
Press the prompt to configure
2. Deploy onemanager
Let's just mention it here
Click me to download the latest code
Upload the code to the website directory
Configure pseudo static The rules
Follow the instructions to install , And will OneDrive Mount it .
3. Configure automatic download and upload
In the first step , installed aria2 Tips are as follows
RPC port : 6800 RPC secret key : xxxx Download directory : /root/downloads AriaNg link :
there ariang It's our download console
Install uploader
wget https://raw.githubusercontent.com/MoeClub/OneList/master/OneDriveUploader/amd64/linux/OneDriveUploader -P /usr/local/bin/ chmod +x /usr/local/bin/OneDriveUploader
Follow the instructions to install
New file upload.sh
#!/bin/bash
GID="$1";
FileNum="$2";
File="$3";
MaxSize="15728640";
Thread="3"; # Default 3 Threads , Modify yourself , If the server configuration is not good , Not too much
Block="20"; # Default blocking 20m, Modify yourself
RemoteDIR="download/"; # Upload to Onedrive The path of , Default to root , If you want to upload to File Catalog ,"" Please fill in File
LocalDIR="/root/download/"; # Aria2 Download directory , Remember to add... At the end /
Uploader="/usr/local/bin/OneDriveUploader"; # The full path of the uploaded program , The default is the directory installed in this article
Config="/root/auth.json"; # Initialize the generated configuration auth.json Absolute path
if [[ -z $(echo "$FileNum" |grep -o '[0-9]*' |head -n1) ]]; then FileNum='0'; fi
if [[ "$FileNum" -le '0' ]]; then exit 0; fi
if [[ "$#" != '3' ]]; then exit 0; fi
function LoadFile(){
if [[ ! -e "${Uploader}" ]]; then return; fi
IFS_BAK=$IFS
IFS=$'\n'
tmpFile="$(echo "${File/#$LocalDIR}" |cut -f1 -d'/')"
FileLoad="${LocalDIR}${tmpFile}"
if [[ ! -e "${FileLoad}" ]]; then return; fi
ItemSize=$(du -s "${FileLoad}" |cut -f1 |grep -o '[0-9]*' |head -n1)
if [[ -z "$ItemSize" ]]; then return; fi
if [[ "$ItemSize" -ge "$MaxSize" ]]; then
echo -ne "\033[33m${FileLoad} \033[0mtoo large to spik.\n";
return;
fi
${Uploader} -c "${Config}" -t "${Thread}" -b "${Block}" -s "${FileLoad}" -r "${RemoteDIR}" -skip
if [[ $? == '0' ]]; then
rm -rf "${FileLoad}";
fi
IFS=$IFS_BAK
}
LoadFile;Don't copy the code !, Fill in according to personal configuration .
Enter the command aria2
Open profile , Find the following text , Click below to modify .
on-download-complete=/root/upload.sh
Input again aria2, restart aria2
Since then, our automatic upload and download server has been configured , stay ariang Submitting the download task will automatically upload to OneDrive
If this article helps you , Please give me a big compliment (≧▽≦)
** I am egg yolk , Be with you “ Soar up the clouds ”!
Reference material :https://www.moerats.com/archives/1006/
边栏推荐
- [see you] on October 24, we met at Tencent Binhai building
- Grpc: how to add API log interceptors / Middleware?
- How to build a shopping website? What problems should be paid attention to in the construction of shopping websites?
- Mocktio usage (Part 2)
- golang with script
- How does the fortress machine connect to the server? Which is easy to use, fortress machine or firewall?
- Which brand is a good backup all-in-one machine price
- Tencent cloud CIF engineering effectiveness summit was successfully opened, and coding released a series of new products
- [new double 11] the latest interpretation of Tencent cloud double 11! Get 11000 yuan voucher now!!
- Tencent cloud ASR product -php realizes the authentication request of the extremely fast version of recording file identification
猜你喜欢

Simple and beautiful weather code

Get to know MySQL database

On Sunday, I rolled up the uni app "uview excellent UI framework"
![[summary of interview questions] zj6 redis](/img/4b/eadf66ca8d834f049f3546d348fa32.jpg)
[summary of interview questions] zj6 redis

Community pycharm installation visual database
![[summary of interview questions] zj5](/img/d8/ece82f8b2479adb948ba706f6f5039.jpg)
[summary of interview questions] zj5

QT creator tips

Sorting out of key vulnerabilities identified by CMS in the peripheral management of red team (I)

Ar 3D map technology
随机推荐
General scheme for improving reading and writing ability of online es cluster
Grpc: how to implement the restful API for file uploading?
What is the edge calculator force? What about the edge calculator?
Tencent cloud CIF engineering efficiency summit ends perfectly
What are the security guarantees for cloud desktop servers? What are the cloud desktop server platforms?
Grpc: how to reasonably manage log configuration?
Actual battle case | refuse information disclosure, Tencent cloud helps e-commerce fight against web crawlers
Shopee Clickhouse cold and hot data separation storage architecture and Practice
Differences between EDI and VMI
Lua language development, esp8266 access to Bafa cloud, mqtt and TCP protocols
On Sunday, I rolled up the uni app "uview excellent UI framework"
[congratulations] rock solid! A new generation of AMD Blackstone architecture instance is launched!
QT creator tips
NLP task summary introduction and understanding
How to select a server with appropriate configuration when planning to build a live broadcast platform
Does the user need a code signing certificate? What is the use of a code signing certificate
Grp: how to automatically add requestid in GRP service?
Sorting out of key vulnerabilities identified by CMS in the peripheral management of red team (I)
[new double 11] the latest interpretation of Tencent cloud double 11! Get 11000 yuan voucher now!!
What is elastic scaling in cloud computing? What are the main applications of elastic scaling in cloud computing?