version: "3"
services:
cron:
build:
context: cron
environment:
TZ: Asia/Tokyo
CRON_OPTION: "*/60 * * * *"
CRON_COMMAND: |
# delete 3 days age files
find /var/log/gobgp/ribs/ -type f -name "*.dump*" -mtime +6 | xargs -I arg echo Dlete file: arg
find /var/log/gobgp/ribs/ -type f -name "*.dump*" -mtime +6 | xargs -I arg rm arg
# compress 1 days age file
find /var/log/gobgp/ribs/ -type f -name "*.dump" -mtime +1 | xargs -I arg echo Compress file: arg
find /var/log/gobgp/ribs/ -type f -name "*.dump" -mtime +3 | xargs -I arg bzip2 arg
# rsync
rsync -tvz -6 /var/log/gobgp/ribs/*.dump wide-vsix@example.com:/backup"
volumes:
- /var/log/gobgp:/var/log/gobgp
- $(pwd)/.ssh:/ssh:ro # if you want to use ssh,
-
Notifications
You must be signed in to change notification settings - Fork 0
wide-vsix/simple-cron
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|