From 9fc72325545a14eb5801b667681f5a1619b1113e Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Wed, 16 Jun 2021 10:51:15 +0800 Subject: [PATCH] update --- conf/rsync/crontab | 1 - conf/rsync/{backup.sh => periodic/hourly/backup_sh} | 2 ++ conf/rsync/start.sh | 4 ---- docker-compose.yml | 6 ++---- 4 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 conf/rsync/crontab rename conf/rsync/{backup.sh => periodic/hourly/backup_sh} (58%) delete mode 100644 conf/rsync/start.sh diff --git a/conf/rsync/crontab b/conf/rsync/crontab deleted file mode 100644 index 737b1bd..0000000 --- a/conf/rsync/crontab +++ /dev/null @@ -1 +0,0 @@ -0 */1 * * * /backup.sh \ No newline at end of file diff --git a/conf/rsync/backup.sh b/conf/rsync/periodic/hourly/backup_sh similarity index 58% rename from conf/rsync/backup.sh rename to conf/rsync/periodic/hourly/backup_sh index 30507e3..bdb03a7 100644 --- a/conf/rsync/backup.sh +++ b/conf/rsync/periodic/hourly/backup_sh @@ -1,2 +1,4 @@ #!/bin/sh +echo start at:$(date +%F%n%T) rsync -ratlz -e 'ssh -p 9022' /mnt/ root@49.4.92.112:/data/backup/cicd +echo end at:$(date +%F%n%T) diff --git a/conf/rsync/start.sh b/conf/rsync/start.sh deleted file mode 100644 index 28ef7f3..0000000 --- a/conf/rsync/start.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -crontab /crontab -crond -tail -f /dev/null \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 43a561e..3d1a8ee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,11 +12,9 @@ services: restart: always volumes: - ./conf/rsync/.ssh:/root/.ssh - - ./conf/rsync/crontab:/crontab - - ./conf/rsync/backup.sh:/backup.sh - - ./conf/rsync/start.sh:/start.sh - ${RSYNC_LOCAL}:/mnt - command: sh -c "chmod 755 /start.sh && /start.sh" + - ./conf/periodic:/etc/periodic + command: "crond -f" portainer: image: portainer/portainer-ce:2.5.1 restart: always