• 0 Posts
  • 93 Comments
Joined 1 year ago
cake
Cake day: June 13th, 2023

help-circle




  • Lemmy seems a lot less toxic than Reddit.

    Not sure I am seeing the same. I posted a message about a bash command yesterday and it was almost immediately downvoted. And I have no idea why since it should work for what the person asking wanted/needed. That was one of my big issues with reddit was the sheer negativity that came out of that site and I know I am talking about a single downvote here, but it makes me pause. It has happened more than this one time which is why I get that feeling. I think some people really need to revisit the use of the downvote.







  • Mine falls along with the people who were distracted. Was doing two deployments for work on night and on one I need to clear a cache. As I was typing the cd command, I happened to glance at the instructions for the other deployment and for some reason my mind switched to the deployment folder. I then typed out rm -rf *, and as I hit return realized I wasn’t in the cache subdir. Blew away our prod environment and it took hours to get it all restored. The restore kept asking the guy to go pull tape #xxx. It was nerve wracking because depending on the tape, there was a chance it was moved offsite. Got it all restored and turned it back on, and then had to start back from the beginning since the backup was from the night before. The other people doing deployments weren’t too happy, but I owned up immediately and we ended up changing the procedure. First, the cache clearing was done via a script after that, and I won my argument about not having to do two deployments simultaneously!










  • It’s going to take a little work here, but I have a large drive on my plex, and a couple of smaller drives that I back everything up to. On the large drive get a list of the main folders. You can do a “du -h --max-depth=1 | sort -hk1” on the root folder to get an idea of how you should split them up. Once you have an idea, make two files, each with their own list of folders (eg: folders1.out and folders2.out) that you want to go to each separate drive. If you have both of the smaller drives mounted, just execute the rsync commands, otherwise, just do each rsync command with the corresponding drive mounted. Here’s an example of my rsync commands. Keep in mind I am going from an ext4 filesystem to a couple of ntfs drives, which is why I use the size only. Make sure and do a dry run or two, and you may or may not want the ‘–delete’ command in there. Since I don’t want to keep files I have deleted from my plex, I have it delete them on the target drive also.

    sudo rsync -rhi --delete --size-only --progress --stats --files-from=/home/plex/src/folders1.out /media/plex/maindrive /media/plex/4tbbackup

    sudo rsync -rhi --delete --size-only --progress --stats --files-from=/home/plex/src/folders2.out /media/plex/maindrive /media/plex/other4tbdrive