Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ Stupid simple local backups with systemd, Borg and microSD card.

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š Stupid simple local backups with systemd, Borg and microSD card.


๐Ÿ’ก Newskategorie: Linux Tipps
๐Ÿ”— Quelle: reddit.com

My Thinkpad has a nice flushed SD card slot I don't use for anything in particular. I also had a pretty decent microSD card laying around. Well... until now. If you don't have a card buy a fast Samsung or Sandisk in whatever size you want. Mine is 16GB and it's plenty enough for documents and scripts etc.

[disclaimer] this is only a local laptop backup protecting mostly from accidental data removal and providing some historic data. For anything serious you still want a real backup, preferably 3-2-1. This info is provided as-is with no warranty of any kind.

Create the necessary files:

For those who don't know .timer unit is like a `cron` on steroids. This one will run a job once a day (OnCalendar=daily) and imminently after wakeup/boot if it's past the schedule (Persistent=true).

[root@x260 ~]# cat /etc/systemd/system/borg-backup.timer [Unit] Description=Run Borg backup daily [Timer] OnCalendar=daily Persistent=true AccuracySec=1h [Install] WantedBy=timers.target 

This is the actual .service unit called by the .timer (notice the file names). systemd automatically find the coresponding service file based on the names. It'll automatically mount what's needed. For that we need next thing.

[root@x260 ~]# cat /etc/systemd/system/borg-backup.service [Unit] Description=Borg Backup RequiresMountsFor=/mnt/backup [Service] Type=oneshot ExecStart=/root/borg.sh 

This one is needed to have the mounting binded to service. It'll unmount device after the job is done (StopWhenUnneeded=true). The idea here is to have backups hidden from accidental removal by the user. Change the UUID to match your device.

[root@x260 ~]# cat /etc/systemd/system/mnt-backup.mount [Unit] StopWhenUnneeded=true BindsTo=borg-backup.service [Mount] What=/dev/disk/by-uuid/aba306f6-aaea-4374-aa6c-8af637fe4e8d Where=/mnt/backup Type=ext4 

Create backup directory.

# mkdir /mnt/backup # chmod 650 /mnt/backup 

Setup a borg repo on the card. Create borg script in /root. Everything is explained here: https://borgbackup.readthedocs.io/en/stable/quickstart.html

I used mostly the default script from the link with minor tweaks. Change `BORG_REPO` to local path (in my case /mnt/backup/borg_backups/). Change paths. Exclude ~/Downloads, ~/.local, ~/.cache. Remember to make script executable.

Protip: Add this variable so the job won't fail even if you start playing around with the Borg repo under a different path.

#For "Warning: The repository at location ... was previously located at ..." export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes 

If you want to play around the recovery mount it manually under different path (e.g. /mnt/recovery) because /mnt/backup (in this example) will be automatically unmounted by systemd (becasue it's not needed by the service, duh). Or you know, mask the service and mount units. Should do the trick.

Bonus: add entry to /etc/fstab so the card won't be mountable from DE or by the user (systemd will the the magic behind the scenes).

UUID=aba306f6-aaea-4374-aa6c-8af637fe4e8d /mnt/backup ext4 noauto,nouser,nofail,x-systemd.device-timeout=1ms 0 2 

I was looking at udev and other means on how to protect the card from hypothetical rm -rf or hypothetical ransomware from the level of regular user but the fstab does seems to do the trick.

Enable the timer:

systemctl enable borg-backup.timer 

You can run backups ad-hoc:

systemctl start borg-backup.service 

If I didn't forget anything it'll work. Check the logs:

journalctl -u borg-backup 

Enjoy.

submitted by /u/masteryod
[link] [comments] ...



๐Ÿ“Œ Stupid simple local backups with systemd, Borg and microSD card.


๐Ÿ“ˆ 98.34 Punkte

๐Ÿ“Œ 85% (approximately 10k) of systemd package crashes are sigaborts of systemd-journald ยท Issue #9079 ยท systemd/systemd ยท GitHub


๐Ÿ“ˆ 44.83 Punkte

๐Ÿ“Œ HPR3205: Backups of your Backups of Backups


๐Ÿ“ˆ 36.56 Punkte

๐Ÿ“Œ [local] systemd (systemd-tmpfiles) < 236 - 'fs.protected_hardlinks=0' Local Privilege Escalation


๐Ÿ“ˆ 34.5 Punkte

๐Ÿ“Œ Stupid, stupid MacOS security flaw grants admin access to anyone


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ HPR3678: "Stupid Users" ... no, not those users, the other "stupid users"


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Stupid Is as Stupid Does: XDR Is About the Journey, Not the Destination


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Easy backups with Borg: Encrypted, deduplicated, fast and Open-Source


๐Ÿ“ˆ 33.77 Punkte

๐Ÿ“Œ Secure external backups with LUKS, Borg and BLAKE2.


๐Ÿ“ˆ 33.77 Punkte

๐Ÿ“Œ The latest and last instalment on systemd units: How systemd makes setting up (simple) sockets a piece of cake


๐Ÿ“ˆ 32.23 Punkte

๐Ÿ“Œ Anybody here used borg for backups? Do you like it?


๐Ÿ“ˆ 31.98 Punkte

๐Ÿ“Œ Format SD Card Or MicroSD Card Software


๐Ÿ“ˆ 30.23 Punkte

๐Ÿ“Œ #0daytoday #systemd (systemd-tmpfiles) &amp;lt; 236 - fs.protected_hardlinks=0 Local Privilege [#0day #Exploit]


๐Ÿ“ˆ 28.46 Punkte

๐Ÿ“Œ [utility] bkp - simple utility for creating simple backups


๐Ÿ“ˆ 28.24 Punkte

๐Ÿ“Œ [utility] bkp - simple utility for creating simple backups


๐Ÿ“ˆ 28.24 Punkte

๐Ÿ“Œ What do all those microSD and SD card numbers and letters mean?


๐Ÿ“ˆ 25.72 Punkte

๐Ÿ“Œ Automating Laptop Backups with Restic and Systemd


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ How to set up the Stupid Simple Server Monitoring app on Linux


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ How to set up the Stupid Simple Server Monitoring app on Linux


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ How to set up the Stupid Simple Server Monitoring app on Linux


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ I wrote a stupid simple BASH script to bootstrap the Arch Linux installer


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ I wrote a stupid simple BASH script to bootstrap Arch Linux


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ CVE-2023-6902 | codelyfe Stupid Simple CMS up to 1.2.4 /file-manager/upload.php file unrestricted upload


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ CVE-2023-7041 | codelyfe Stupid Simple CMS up to 1.2.4 /file-manager/rename.php newName path traversal


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ UK Researcher Finds Stupid Simple Method to Bypass PayPal 2FA


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ UK Researcher Finds Stupid Simple Method to Bypass PayPal 2FA


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ UK Researcher Finds Stupid Simple Method to Bypass PayPal 2FA


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ UK Researcher Finds Stupid Simple Method to Bypass PayPal 2FA


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ UK Researcher Finds Stupid Simple Method to Bypass PayPal 2FA


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ CVE-2023-7040 | codelyfe Stupid Simple CMS up to 1.2.4 /file-manager/rename.php oldName path traversal


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ CVE-2024-22715 | Stupid Simple CMS up to 1.2.4 /admin-edit.php cross-site request forgery


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ CVE-2023-6901 | codelyfe Stupid Simple CMS up to 1.2.3 HTTP POST Request handle-command.php command os command injection


๐Ÿ“ˆ 25.18 Punkte

๐Ÿ“Œ CVE-2023-6907 | codelyfe Stupid Simple CMS up to 1.2.4 Deletion Interface /file-manager/delete.php file improper authentication


๐Ÿ“ˆ 25.18 Punkte











matomo