lol, you’re braver than me. No one ever sees the “code” I’ve written.
Comment on I wrote a python script to backup my home directory
waspentalive@lemmy.one 4 weeks agoIt’s also to help me learn python. And it works for me. : ^ )
rc__buggy@sh.itjust.works 4 weeks ago
waspentalive@lemmy.one 4 weeks ago
That’s ok Like any landing you can walk away from. Any code that runs to spec is good, much could be better.
ChapulinColorado@lemmy.world 4 weeks ago
Bash does seem like a better fit for this kind of script since it is a lot more portable.
I.e.: It comes by default for many Linux distributions. For windows, a Git bash install will get you most utilities needed for large reliable scripts (grep, scp, find, sort, uniq, cat, tr, ls, etc.).
With that said, you should write it on whatever language you want, especially if it is for learning purposes, that’s where the fun comes from :)
newthrowaway20@lemmy.world 4 weeks ago
Don’t mind him. Any time someone shares code, there’s always someone else who did nothing talking about how much better your work could have been.
waspentalive@lemmy.one 4 weeks ago
Yeah, no problem… I started out with just bare rsync - but I did the backup infrequently and needed my notes to know the command. Then I wrote a simple shell script to run the rsync for me. Then I decided I needed more than one backup, redundancy is good. Then I wanted to keep track of the backups so I had it write to .backuplog then that file started getting dated (every time I run a “sun” backup the record of the previous one is useless) so Finally TaDa! loci is born.