当前位置:网站首页>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/
边栏推荐
- Is the cloud desktop server highly required for installation and configuration? Is cloud desktop easy to use?
- How to install CentOS 6.5 PHP extension
- What does elastic public IP mean? The advantages of elastic public IP
- What is the edge calculator force? What about the edge calculator?
- Record the creation process of a joke widget (II)
- Disaster recovery series (V) -- database disaster recovery construction
- Interpreting Tencent cloud product experience through user experience elements
- Grpc: how to reasonably manage log configuration?
- [hot] with a budget of only 100 yuan, how to build a 1-year web site on Tencent cloud??
- How to build glasses website what are the functions of glasses website construction
猜你喜欢
![[summary of interview questions] zj5](/img/d8/ece82f8b2479adb948ba706f6f5039.jpg)
[summary of interview questions] zj5

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

QT creator tips

Simple and beautiful weather code

Ar 3D map technology

On Sunday, I rolled up the uni app "uview excellent UI framework"

Get to know MySQL database

Community pycharm installation visual database
![[summary of interview questions] zj6 redis](/img/4b/eadf66ca8d834f049f3546d348fa32.jpg)
[summary of interview questions] zj6 redis
随机推荐
Differences between EDI and VMI
Dry goods how to build a data visualization project from scratch?
How is intelligent character recognition realized? Is the rate of intelligent character recognition high?
A figure showing the price and expense structure of Tencent cloud real-time audio and video TRTC
Interpreting Tencent cloud product experience through user experience elements
[new double 11] the latest interpretation of Tencent cloud double 11! Get 11000 yuan voucher now!!
NLP task summary introduction and understanding
How does the fortress machine connect to the server? Which is easy to use, fortress machine or firewall?
Live broadcast Reservation: cloud hosting or cloud function, how can the business do a good job in technology selection?
Why does the fortress machine use an application publisher? What are the main functions of the fortress machine
[hot] with a budget of only 100 yuan, how to build a 1-year web site on Tencent cloud??
Sinclair radio stopped broadcasting many TV stations, suspected of being attacked by blackmail software
What aspects does the intelligent identification system include? Is the technology of intelligent identification system mature now?
How to use elastic scaling in cloud computing? What are the functions?
What is the all-in-one backup machine? How about its cost performance
Elk7.15.1 installation, deployment and construction
Is it necessary to buy EIP? Price analysis of EIP
What technology does cloud computing elasticity scale? What are the advantages of elastic scaling in cloud computing?
How to choose excellent server hosting or server leasing in Beijing
MySQL stored procedure + function