mirror of
https://github.com/tickstep/aliyunpan.git
synced 2025-02-02 21:27:15 +08:00
add linux service config sample
This commit is contained in:
parent
3d1aa1c8bb
commit
bc2ab0625f
17
assets/scripts/service/aliyunpansync.service
Normal file
17
assets/scripts/service/aliyunpansync.service
Normal file
@ -0,0 +1,17 @@
|
||||
# linux service 配置文件模版
|
||||
# centos系统默认存放路径为:/lib/systemd/system/aliyunpansync.service
|
||||
# 启动服务:systemctl start aliyunpansync
|
||||
# 停止服务:systemctl stop aliyunpansync
|
||||
|
||||
[Unit]
|
||||
Description=aliyunpansync
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/path/to/start.sh
|
||||
ExecStop=/path/to/stop.sh
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
5
assets/scripts/service/start.sh
Normal file
5
assets/scripts/service/start.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 更改路径为你电脑sync.sh文件所在文件夹路径
|
||||
cd /path/to/your/sync.sh/folder
|
||||
nohup ./sync.sh >/dev/null 2>&1 &
|
9
assets/scripts/service/stop.sh
Normal file
9
assets/scripts/service/stop.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
PROCESS=`ps -ef|grep aliyunpan|grep -v grep|grep -v PPID|awk '{ print $2}'`
|
||||
for i in $PROCESS
|
||||
do
|
||||
# kill进程
|
||||
kill -9 $i
|
||||
break
|
||||
done
|
@ -1,5 +1,8 @@
|
||||
@echo off
|
||||
|
||||
REM 配置环境变量
|
||||
REM set ALIYUNPAN_CONFIG_DIR=d:\path\to\your\aliyunpan\config
|
||||
|
||||
REM 指定refresh token用于登录
|
||||
aliyunpan login -RefreshToken=9078907....adg9087
|
||||
|
||||
|
@ -3,6 +3,9 @@
|
||||
# 请更改成你自己电脑上aliyunpan执行文件所在的目录
|
||||
#cd /path/to/aliyunpan/folder
|
||||
|
||||
# 配置环境变量
|
||||
#export ALIYUNPAN_CONFIG_DIR=/path/to/your/aliyunpan/config
|
||||
|
||||
chmod +x ./aliyunpan
|
||||
|
||||
# 指定refresh token用于登录
|
||||
|
@ -1,5 +1,8 @@
|
||||
@echo off
|
||||
|
||||
REM 配置环境变量
|
||||
REM set ALIYUNPAN_CONFIG_DIR=d:\path\to\your\aliyunpan\config
|
||||
|
||||
REM 指定refresh token用于登录
|
||||
aliyunpan login -RefreshToken=9078907....adg9087
|
||||
|
||||
|
@ -3,6 +3,9 @@
|
||||
# 请更改成你自己电脑上aliyunpan执行文件所在的目录
|
||||
#cd /path/to/aliyunpan/folder
|
||||
|
||||
# 配置环境变量
|
||||
#export ALIYUNPAN_CONFIG_DIR=/path/to/your/aliyunpan/config
|
||||
|
||||
chmod +x ./aliyunpan
|
||||
|
||||
# 指定refresh token用于登录
|
||||
|
Loading…
Reference in New Issue
Block a user