New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
The learning by 🔥 thread
Today, I decided it was a good time to back up my backup files, so I wrote a script.
#!/bin/bash
BACKUP_DIR="/var/backup"
GPG_RECIPIENT="[email protected]"
find "$BACKUP_DIR" -name "*.tar.gz" -exec gpg --encrypt --recipient "$GPG_RECIPIENT" --trust-model always {} \;
rsync -avz --remove-source-files /var/backup/ user@remote_server:/backup/
Then I ran the script, checked the destination server, and realized I had made a small mistake, because it synced everything, including the unencrypted files.
So I deleted the files on the destination server (rm -rf *) and fixed my script by adding --include='*.gpg' --exclude='*' to the rsync line.
Then I ran the script again.
sent 51 bytes received 12 bytes 42.00 bytes/sec
total size is 0 speedup is 0.00

Please share one of your fuckups, so I feel a little less stupid.
![]()
Thanked by 14zed oloke theonewhoknocks rcy026 BasToTheMax FAT32 xauser OhJohn mandala usr123 RIYAD JerryHou beanman109 ebietsy


Comments
Sorry for your loss but this is a great idea for a thread
Happens to best of us.
Also, a small suggestion, the idea with gpg encrypting every tar.gz archive is neat, but there is also rclone with crypt remote. It may actually make your script less sophisticated and thus more error prone
Personally, I didn't have any data loss incidents (yet) but once I made a typo in the
/etc/network/interfacesfile (something silly like255.255.25.0) and lost access to a remote server, so I had to drive there just to fix it.This is really helpful
i may or may not have punched my laptop battery with a screwdriver in attempt to swap out the thermal paste
Well my biggest fuck up is still this:
vs
Needless to say I spend a lot of time trying to recover the files
I was once fucked by a bind mount
I will never forget that moment
Always check the file directory or shell you're in. Once I deleted a DB from production thinking I was on dev environment none the less, fuck ups before it taught me to have backups and nothing was lost.
That's really doing it wrong. Get Arcticlean for next time. Will last forever.
Care to explain the difference to n00bz?
You have learned nothing if you had backups and lost nothing
sudo rm -rf $typo/$typovariations...The greatest part is that we tend of forget passwords by saving them in browsers and other applications!
I wrong mount disk on /etc/fstab (/dev/sdb instead /dev/sdd) for prolong time, and format /dev/sdb cause i thinking backup on /dev/sdd
This is the benefit of a Trash/Recycling bin feature. When will systemd fix that, eh?