• 0 Posts
  • 6 Comments
Joined 1 year ago
cake
Cake day: August 3rd, 2023

help-circle

  • The status code that gets returned should be the status code of the messenger and not the data. If you want to add a status code about the data, then please do.

    If something can return null and empty and it’s valid, that is not a 404. That is a 200.

    As far as a 403, the messenger is telling you that you shall not pass. There is no data. 403 is appropriate here. The return response can be anything since 403 is pretty self explanatory, but I would probably return json to be consistent. I would also use the field message. Something like the first one for this use case only.

    In other cases where i do get data, I would use data, message, status (optional). But status in the json response would be status about the message.





  • You can use a few tools.

    RSync

    Rclone - probably want this one over RSync though.

    Tarsnap

    Duplicati

    Restic

    There’s obviously a lot more, but these are some of the more popular ones.

    Now you need a way to back it up. Probably the best way is to tar it up first and then dump that file. You can also get something like deadmans snitch to ensure backups don’t break.

    As you mentioned, if this is just source code, then the best thing would be to create source control and have it set up that way. Then you automate it and deploy the code when you make updates and have a history of changes.

    It sounds like tarsnap is your best bet though. It will be the cheapest.

    You can also backup to another storage provider like Google, Dropbox, or even AWS s3. S3 can get costly, but you can archive everything to the glacier tier which is pretty cheap.