Jumpaku / services

MIT License
0 stars 1 forks source link

Data Backup #7

Open Jumpaku opened 5 years ago

Jumpaku commented 5 years ago
FROM debian:buster-slim

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y cron nextcloud-desktop-cmd curl
RUN curl https://raw.githubusercontent.com/owncloud/client/master/sync-exclude.lst > /sync-exclude.lst

CMD ["entrypoint.sh"]
version: '3'

services: 
  debian-example:
    container_name: 'debian-example'
    build: './'
    volumes: 
      - './data/:/sync_base_dir/sync_dir/'
    environment: 
      - 'NEXTCLOUD_USER=nextcloud_user'
      - 'NEXTCLOUD_PASSWORD=nextcloud_password'
      - 'SYNC_DIR=sync_dir'
      - 'NEXTCLOUD_BASE_URI=https://nextcloud.jumpaku.net/remote.php/webdav/'
      - 'SYNC_BASE_DIR=/sync_base_dir/'
#!/bin/bash

NEXTCLOUD_USER="nextcloud_user"
NEXTCLOUD_PASSWORD="nextcloud_password"
SYNC_DIR="sync_dir"
NEXTCLOUD_BASE_URI="https://nextcloud.jumpaku.net/remote.php/webdav/"
SYNC_BASE_DIR="/sync_base_dir/"
mkdir -p "$SYNC_DIR"
echo "5  *  *  *  *  root nextcloudcmd --user $NEXTCLOUD_USER --password $NEXTCLOUD_PASSWORD --exclude /sync-exclude.lst $SYNC_BASE_DIR/$SYNC_DIR $NEXTCLOUD_BASE_URI/$SYNC_DIR/" > /etc/crontab

cron -f