This commit is contained in:
zhiqiang feng
2025-12-29 13:38:39 +08:00
commit 1a4aa9a660
579 changed files with 388880 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
### Notes
```dataview
table file.ctime as Date from "2. Areas/Health"
sort file.name
```
+73
View File
@@ -0,0 +1,73 @@
### 数据同步
佳明国服数据同步到外服
[[DailySync · GitLab]]
- 安装node执行环境
安装 nvm
```shell
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
```
安装 node yarn
```shell
$ nvm install --lts
$ npm install -g yarn
```
- 安装软件
```shell
$ git clone https://gitlab.com/zhiqiangf/dailysync.git
$ yarn
```
- 配置帐号
打开 src/constant.ts 编辑帐号名
```typescript
// 佳明中国区账号及密码
export const GARMIN_USERNAME_DEFAULT = '';
export const GARMIN_PASSWORD_DEFAULT = '';
// 佳明国际区区账号及密码
export const GARMIN_GLOBAL_USERNAME_DEFAULT = '';
export const GARMIN_GLOBAL_PASSWORD_DEFAULT = '';
```
- 配置定时任务
```shell
$ vi sync.sh
#!/usr/bin/zsh
cd /opt/dailysync/dailysync
yarn sync_cn >> /var/log/dailysync.log
#yarn sync_global >> /var/log/dailysync.log
$ crontab -e
0 * * * * /opt/dailysync/dailysync/sync.sh
$ chmod +x sync.sh
$ sudo vim /etc/logrotate.d/dailysync
/var/log/dailysync.log {
monthly
create 0644 windy root
rotate 5
size=1M
dateext
dateformat -%d%m%Y
notifempty
}
```