Compare commits
No commits in common. "aad451f5cea948c206301d05a8b9b7abaad5e912" and "2bf04c9e851075920320a0a995a159bafb1c8d0c" have entirely different histories.
aad451f5ce
...
2bf04c9e85
@ -1,8 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
import time
|
import time
|
||||||
import datetime
|
|
||||||
import selenium.common.exceptions
|
import selenium.common.exceptions
|
||||||
|
import urllib3
|
||||||
import logging
|
import logging
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
@ -12,7 +12,7 @@ logging.basicConfig(
|
|||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
format="%(levelno)s - %(levelname)s - %(asctime)s - %(name)s - %(message)s",
|
format="%(levelno)s - %(levelname)s - %(asctime)s - %(name)s - %(message)s",
|
||||||
datefmt="%Y-%m-%d %H:%M:%S",
|
datefmt="%Y-%m-%d %H:%M:%S",
|
||||||
filename=f"logs/{datetime.date.today()}.log",
|
filename="log.log",
|
||||||
filemode="a"
|
filemode="a"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
18
README.md
18
README.md
@ -19,23 +19,7 @@ BUCT_AUTHENTICATION_PASSWORD=校园网密码
|
|||||||
## 关于service
|
## 关于service
|
||||||
|
|
||||||
由于用到了logging。所以service里面要加上`WorkingDirectory=/path/to/programe`来确保文件可以正常写入 。
|
由于用到了logging。所以service里面要加上`WorkingDirectory=/path/to/programe`来确保文件可以正常写入 。
|
||||||
出错先找找权限问题,我应该是直接给了755。这里是一个servivce的配置文件例子。
|
出错先找找权限问题,我应该是直接给了755。
|
||||||
```YAML
|
|
||||||
[Unit]
|
|
||||||
Description=Auto authentication.
|
|
||||||
After=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=/path/to/your/python /path/to/your/program
|
|
||||||
WorkingDirectory=/path/to/your/program
|
|
||||||
User=Your_User
|
|
||||||
Restart=always
|
|
||||||
RestartSec=60
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user