The proper way to store files?

The proper way to store files?
0.0 0

#1

Hey everyone, I was just wondering if anyone had any tips for a good way of storing files. I just got a new mac and am transferring all my files over, and I used to have just everything on my desktop but I feel as if there has got to be a better way. I am also trying to transfer my data through an external hard drive and have to give permissions for each individual folder which is annoying. If anyone knows a way around that it would be much appreciated. Aslo is there a way to automate this? I just want to make sure I don’t miss anything.

Oh especially my files for languages (ruby, python etc.) I keep hearing about storing those in the root folder but there are only desktop, applications, and document folders that I see on finder. Or should I move them in the CLI?

Thanks!


#2

How you do this depends on what you mean by “files”. For programs that you’re writing, non-sensitive configuration files, or notes, consider using Github. Apps, images, movies, music and other large files should be backed up as much as you possibly can. I run my own cloud service with Nextcloud and use this to duplicate almost everything I save on my computers. Movies and music go straight to the same server which also runs Emby so that I only need to store media in one location. When I finally get a backup service like Crashplan, I’ll only have one computer that needs backed up. This isn’t a cheap or simple solution, but it’s robust.

Since it seems you’re using macOS, you can automate almost everything in Bash. You’ll also likely be able to leverage some sort of package manager so that you don’t need to back up many apps or settings. I have an install script in my dotFiles repo that will detect whether I’m running on Mac or Ubuntu/Manjaro/Arch and install everything I need to get going. For the Mac specifically, I’ve got a separate setup script that takes care of most of the settings I like. i3, Gnome, and KDE settings can be stored in files so I don’t bother with a Linux setup script.

Thanks to the combination of offloading large files and automation scripts, I can go from a fresh new computer to something that feels like mine in less than an hour. To me, that’s much better than having a complicated backup solution. Still, don’t discount the usefulness of Time Machine to do this stuff, too. Spring for a Time Capsule, make sure everything you care about is covered and rest easy.


#3

Wow this was very informative, I’m going to take several moments to go through this. But I was also wondering if there was a way on mac to make alll of my files accessable from my old one becaus I am having to manually give myself permissions for everything from my old computer.


#4

Hi while my media files are all over the place, I like to store my source code in a dev/ folder under my home folder. This path looks like: /Users/[name]/dev/. Under this, I like to follow Go’s convention, which saves projects under [domain]/[user]/[project name].

The result is something that looks like:

/Users/mtso/dev/github.com/mtso/proj1
/Users/mtso/dev/github.com/mtso/proj2
/Users/mtso/dev/gitlab.com/mtso/proj3
/Users/mtso/dev/bitbucket/mtso/proj4
/Users/mtso/dev/github.com/peer/proj5
/Users/mtso/dev/github.com/peer/proj6

Then, with tooling dependencies, like node.js or Rails, I’ve started to use docker containers to manage environments and mount the /home directory in each image to the /dev folder in my computer. This is great for managing different node versions and cleaning up programs after an old project.

docker run -d --volume /Users/mtso/dev:/home --port 3000:3000 --name node8 node:latest

The -d is for detached mode, and the volume and port parameters follow [host]:[container] pattern.


#5

What do you mean? Can you post a screenshot of what it’s doing when it asks you for permission?

The safest thing to try is to open up Disk Utility while your external drive is plugged in. Select your drive on the left and hit ‘First Aid’ on the toolbar. If that doesn’t work, we can manually change all of the permissions on your external drive with one line in Bash. It’s safe to do as long as all of the files should have the same permissions.

sudo chown -R $(whoami):$(whoami) /Volumes/path/to/your/external/drive

or the more extreme

sudo chmod -R 777  /Volumes/path/to/your/external/drive

#6

The specific problem was that I did not have access to my old files so I had to go into the folder and enable permissions for this computer to read and write on the files I had transferred.

im getting this error when I try the chmod method, I already manually gave myself permissions for everything I was more just curious as to if there was a better way.

Declans-MacBook-Pro:~ declan$ sudo chmod -R 777 desktop/Backups.backupdb
chmod: Unable to change file mode on desktop/Backups.backupdb/.RecoverySets/0/com.apple.recovery.boot/boot.efi: Operation not permitted

also for the chown im getting an illegal group name error. Do I literally type in (whoami)?


#7

So you got a new Mac and an old mac and you want to transfer files to your new mac.

Why don’t you just go to system preferences and enable file sharing? Connect to your old Mac from your new mac and just drag files between the 2 finder windows.


#8

use rsync, your Macs are on the same network so use that to your advantage instead of sneaker net.
get to your command line and type man rsync or follow some online instructions…


#9

Woah there. That’s a Time Machine backup. You should let Time Machine handle that. Try following these directions: https://support.apple.com/en-us/HT202380


#10

Yeah that would have been the best way definitely, I just didn’t have mooney for the cable but had a external hard drive. But now that I think about it I definitely should have enabled file sharing first. That problem has been solved though, I was more asking on here just techniques for storing files. Wondering how everyone else did it. But thank you for your answer.


#11

Oh woah rsync is awesome I already moved everything but, thats really cool I could grab files from my other laptop like that


#12

yeah thats what I actually ended up doing :grimacing:

sorry that was actually a really easy fix.


#13

File sharing via wi-fi or wired ethernet works.

Also would help if you have a USB-SATA cable or USB drive dock. You can use it as extra storage, or in this case, for transferring contents of a HD to your Mac.

Glad you got your problem solved.