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