What's new
PGBlitz.com

Register Now! Find useful tips, Interact /w Community Members and join the part the Best Community on the Internet!

UrBackup [Community App]

duckstain

Junior Member
I have done some initial work on this app, but can't seem to figure out how to get it to play nicely with migrating data to my google drive. I have been successful in running a backup of my computer where the data eventually ends up in my google drive, but UrBackup loses track of the data which causes the backups to run continuously. I also haven't figured out what is needed to allow backups to run even when port guard is enabled. The code is below with the volumes pointed to my local drive at the moment.

YAML:
#!/bin/bash
#
# Title:      PGBlitz (Reference Title File)
# Author(s):  Admin9705
# URL:        https://pgblitz.com - http://github.pgblitz.com
# GNU:        General Public License v3.0
################################################################################
---
- hosts: localhost
  gather_facts: false
  tasks:
    # FACTS #######################################################################
    - name: 'Set Known Facts'
      set_fact:
        pgrole: 'urbackup'
        intport: '55414'
        extport: '55414'
        intport3: '55413'
        extport3: '55413'
        intport4: '55415'
        extport4: '55415'
        intport2: '35623/udp'
        extport2: '35623'
        image: 'uroni/urbackup-server'

    # CORE (MANDATORY) ############################################################
    - name: 'Including cron job'
      include_tasks: '/opt/communityapps/apps/_core.yml'

    # LABELS ######################################################################
    - name: 'Adding Traefik'
      set_fact:
        pg_labels:
          traefik.frontend.auth.forward.address: '{{gauth}}'
          traefik.enable: 'true'
          traefik.port: '{{intport}}'
          traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'

    - name: 'Setting PG Volumes'
      set_fact:
        pg_volumes:
          - '/etc/localtime:/etc/localtime:ro'
          - '/etc/timezone:/etc/timezone:ro'
          - '/opt/appdata/{{pgrole}}/backups:/backups'
          - '/opt/appdata/{{pgrole}}:/var/urbackup'

    - name: 'Setting PG ENV'
      set_fact:
        pg_env:
          PUID: '1000'
          PGID: '1000'

    # MAIN DEPLOYMENT #############################################################
    - name: 'Deploying {{pgrole}}'
      docker_container:
        name: '{{pgrole}}'
        image: '{{image}}'
        privileged: true
        pull: yes
        published_ports:
          - '{{ports.stdout}}{{extport}}:{{intport}}'
          - '{{ports.stdout}}{{extport2}}:{{intport2}}'
          - '{{ports.stdout}}{{extport3}}:{{intport3}}'
          - '{{ports.stdout}}{{extport4}}:{{intport4}}'
        volumes: '{{pg_volumes}}'
        env: '{{pg_env}}'
        restart_policy: unless-stopped
        networks:
          - name: plexguide
            aliases:
              - '{{pgrole}}'
        state: started
        labels: '{{pg_labels}}'
Any ideas? Thanks in advance for any assistance on this!
 

sixshooterz

Full Member
Shouldn't the volume /backups point to /mnt/unionfs/urbackup instead of appdata in order to be uploaded to gdrive? I don't have a machine available to test at the moment.

Not sure on portguard as I don't use it.
 

duckstain

Junior Member
Shouldn't the volume /backups point to /mnt/unionfs/urbackup instead of appdata in order to be uploaded to gdrive? I don't have a machine available to test at the moment.

Not sure on portguard as I don't use it.
Yes, I probably should have put that in the code above but I just copied what I currently had working. I just spun up a gce server for testing and will report back here after making that change.
 

duckstain

Junior Member
Fresh install of pgblitz and I have done the following:
Bash:
mkdir /mnt/tdrive/urbackup
chown 1000:1000 /mnt/tdrive/urbackup
chmod -R 775 /mnt/tdrive/urbackup
Created /opt/mycontainers/urbackup.yml:
YAML:
#!/bin/bash
#
# Title:      PGBlitz (Reference Title File)
# Author(s):  Admin9705
# URL:        https://pgblitz.com - http://github.pgblitz.com
# GNU:        General Public License v3.0
################################################################################
---
- hosts: localhost
  gather_facts: false
  tasks:
    # FACTS #######################################################################
    - name: 'Set Known Facts'
      set_fact:
        pgrole: 'urbackup'
        intport: '55414'
        extport: '55414'
        intport3: '55413'
        extport3: '55413'
        intport4: '55415'
        extport4: '55415'
        intport2: '35623/udp'
        extport2: '35623'
        image: 'uroni/urbackup-server'

    # CORE (MANDATORY) ############################################################
    - name: 'Including cron job'
      include_tasks: '/opt/communityapps/apps/_core.yml'

    # LABELS ######################################################################
    - name: 'Adding Traefik'
      set_fact:
        pg_labels:
          traefik.frontend.auth.forward.address: '{{gauth}}'
          traefik.enable: 'true'
          traefik.port: '{{intport}}'
          traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'

    - name: 'Setting PG Volumes'
      set_fact:
        pg_volumes:
          - '/etc/localtime:/etc/localtime:ro'
          - '/etc/timezone:/etc/timezone:ro'
          - '/mnt/unionfs/{{pgrole}}:/backups'
          - '/opt/appdata/{{pgrole}}:/var/urbackup'

    - name: 'Setting PG ENV'
      set_fact:
        pg_env:
          PUID: '1000'
          PGID: '1000'

    # MAIN DEPLOYMENT #############################################################
    - name: 'Deploying {{pgrole}}'
      docker_container:
        name: '{{pgrole}}'
        image: '{{image}}'
        pull: yes
        published_ports:
          - '{{ports.stdout}}{{extport}}:{{intport}}'
          - '{{ports.stdout}}{{extport2}}:{{intport2}}'
          - '{{ports.stdout}}{{extport3}}:{{intport3}}'
          - '{{ports.stdout}}{{extport4}}:{{intport4}}'
        volumes: '{{pg_volumes}}'
        env: '{{pg_env}}'
        restart_policy: unless-stopped
        networks:
          - name: plexguide
            aliases:
              - '{{pgrole}}'
        state: started
        labels: '{{pg_labels}}'
After deploying the container, I got a permission denied from the urbackup user on the /mnt/unionfs/urbackup folder. I went ahead and ran:
Bash:
groupadd -g 1000 abc
useradd -u 1000 -g 1000 abc
usermod -g abc urbackup
This gave me permissions to the folder. I just installed the urbackup client on a test Windows 10 machine and ran a quick file backup. Looks like it worked exactly how it is supposed to. So it looks like the permissions inside of the urbackup container were the reason for problems.

So now that it's working, I guess I just need to convert the extra commands I ran to fix permissions into the yaml config file? What is the best way to accomplish that?
 

sixshooterz

Full Member
Not gonna lie, I've no clue how to accomplish it. MrDoob or admin will be the best ones to help, if they're available.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads


Development Donations

 

Top NZB NewsGroups!

Members - Up To a 58% Discount!

Trending

Online statistics

Members online
9
Guests online
513
Total visitors
522
Top