DataDreadnought

joined 2 years ago
[–] [email protected] 3 points 2 years ago (1 children)

If you look at my recent post history I gave out my script using rclone to backup my server. It's in NixOS but you can ignore it as it is bash scripting at its core. It has everything you need like using rclone to delete older backups.

[–] [email protected] 4 points 2 years ago (1 children)

I doubt your using NixOS so this config might seem useless but at its core it is a simple systemd timer service and bash scripting.

To convert this to another OS you will use cron to call the script at the time you want. Copy the part between script="" and then change out variables like the location of where docker-compose is stored since its different on NixOS.

Let me explain the script. We start out by defining the backupDate variable, this will be the name of the zip file. As of now that variable would be 2023-07-12. We then go to each folder with a docker-compose.yml file and take it down. You could also replace down with stop if you don't plan on updating each night like I do. I use rclone to connect to Dropbox but rclone supports many providers so check it out and see if it has the one you need. Lastly I use rclone to connect to my Dropbox and delete anything older than 7 days in the backup folder. If you end up going my route and get stuck let me know and I can help out. Good luck.

systemd = {
      timers.docker-backup = {
        wantedBy = [ "timers.target" ];
        partOf = [ "docker-backup.service" ];
        timerConfig.OnCalendar= "*-*-* 3:30:00";
      };
      services.docker-backup = {
        serviceConfig.Type = "oneshot";
        serviceConfig.User = "root";
        script = ''
        backupDate=$(date  +'%F')
        cd /docker/apps/rss
        ${pkgs.docker-compose}/bin/docker-compose down

        cd /docker/apps/paaster
        ${pkgs.docker-compose}/bin/docker-compose down

        cd /docker/no-backup-apps/nextcloud
        ${pkgs.docker-compose}/bin/docker-compose down

        cd /docker/apps/nginx-proxy-manager
        ${pkgs.docker-compose}/bin/docker-compose down

        cd /docker/backups/
        ${pkgs.zip}/bin/zip -r server-backup-$backupDate.zip /docker/apps

        cd /docker/apps/nginx-proxy-manager
        ${pkgs.docker-compose}/bin/docker-compose pull
        ${pkgs.docker-compose}/bin/docker-compose up -d

        cd /docker/apps/paaster
        ${pkgs.docker-compose}/bin/docker-compose pull
        ${pkgs.docker-compose}/bin/docker-compose up -d

        cd /docker/apps/rss
        ${pkgs.docker-compose}/bin/docker-compose pull
        ${pkgs.docker-compose}/bin/docker-compose up -d

        cd /docker/no-backup-apps/nextcloud
        ${pkgs.docker-compose}/bin/docker-compose pull
        ${pkgs.docker-compose}/bin/docker-compose up -d

        cd /docker/backups/
        ${pkgs.rclone}/bin/rclone copy server-backup-$backupDate.zip Dropbox:Server-Backup/
        rm server-backup-$backupDate.zip
        ${pkgs.rclone}/bin/rclone delete --min-age 7d Dropbox:Server-Backup/
        '';
      };
    };

[–] [email protected] 12 points 2 years ago (3 children)

If only they had the same titan chip as the Pixel so I could use GrapheneOS on it.

[–] [email protected] 5 points 2 years ago

Hey don't let this scare you away from GrapheneOS as Louis states he doesn't know how this works and cannot trust the code.

You cannot be specifically targeted as a user of GrapheneOS with backdoors from the project. The entire user base would need to be targeted and this project has to many eyes on it to not be noticed by now.

[–] [email protected] 3 points 2 years ago

This is a very good read https://blog.reconinfosec.com/locking-down-zerotier

TLDR: Used at hacker conference Defcon 26 in a blue team (defense team) capture the flag.

[–] [email protected] 58 points 2 years ago (2 children)

Don't understand how they made it this long.

[–] [email protected] 2 points 2 years ago

Really cool thanks for the share.

[–] [email protected] 2 points 2 years ago

For me efficiency and less eye strain is important. I want my eyes to be at the center of the screen for the majority of my session. Gnome is my goto for that reason but any tiling windows manager would do as welll.

KDE and the windows start bar lookalikes constantly have your eyes going to the corner or sides to open and find apps.

[–] [email protected] 2 points 2 years ago (2 children)

I assume you will be using docker and this is a nice security tool to have that cleans PDFs https://github.com/freedomofpress/dangerzone

[–] [email protected] 4 points 2 years ago

Backing up NixOS is very straight forward and easy. It's kinda the same as docker-compose in that respect.

[–] [email protected] 3 points 2 years ago (2 children)

Kagi is slept on for sure

[–] [email protected] -1 points 2 years ago
view more: ‹ prev next ›