add linux service config sample

This commit is contained in:
xiaoyaofenfen 2022-06-20 14:39:31 +08:00
parent 3d1aa1c8bb
commit bc2ab0625f
7 changed files with 43 additions and 0 deletions

View 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

View File

@ -0,0 +1,5 @@
#!/bin/sh
# 更改路径为你电脑sync.sh文件所在文件夹路径
cd /path/to/your/sync.sh/folder
nohup ./sync.sh >/dev/null 2>&1 &

View 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

View File

@ -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

View File

@ -3,6 +3,9 @@
# 请更改成你自己电脑上aliyunpan执行文件所在的目录
#cd /path/to/aliyunpan/folder
# 配置环境变量
#export ALIYUNPAN_CONFIG_DIR=/path/to/your/aliyunpan/config
chmod +x ./aliyunpan
# 指定refresh token用于登录

View File

@ -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

View File

@ -3,6 +3,9 @@
# 请更改成你自己电脑上aliyunpan执行文件所在的目录
#cd /path/to/aliyunpan/folder
# 配置环境变量
#export ALIYUNPAN_CONFIG_DIR=/path/to/your/aliyunpan/config
chmod +x ./aliyunpan
# 指定refresh token用于登录