Program alternative SCRU
from Jack_Burton@lemmy.ca to linux@lemmy.ml on 11 Aug 19:32
https://lemmy.ca/post/49609995

Before I fully make the switch to Linux I’m looking for options to replace an old Windows program called SCRU. You set a folder to watch, and an output folder and it automatically copies specified extensions or extracts rar into the output folder.

I’m trying to figure out if there’s a way to do this in terminal and haven’t dug into scripts yet, just want to know of it’s possible.

#linux

threaded - newest

winety@lemmy.zip on 11 Aug 19:38 next collapse

It might be possible with inotify.

Jack_Burton@lemmy.ca on 11 Aug 19:49 collapse

Interesting, i saw that earlier and I’ll look into it some more. I’ve never done a bash script so I was hesitant. Thanks

winety@lemmy.zip on 11 Aug 20:03 next collapse

It shouldn’t be that hard. Use Shellcheck to check for mistakes. Good luck!

Jack_Burton@lemmy.ca on 11 Aug 20:06 collapse

Appreciate it!

nocteb@feddit.org on 12 Aug 15:52 collapse

You can throw stuff like that into perplexity.ai as a starting point (it’s free):

perplexity.ai/…/before-i-fully-make-the-switch-OT…

You can then continue to ask about stuff you want to understand. It’s a great learning tool.

Jack_Burton@lemmy.ca on 13 Aug 02:14 collapse

Not an ai guy but appreciate you taking the time!

rodsthencones@startrek.website on 11 Aug 20:32 next collapse

Sounds like a nifty program. Is this something you use a lot? What’s the use case? While I know extracting files is not difficult in Linux, there are a lot of different compressed file types. Most have some Linux alternative. Linux is different from windows, in that most things that require a separate program to be installed, are usually default operations. Most file managers offer to compress or extract in the right click menu. Try a live distro for a few days. It will blow your mind.

Jack_Burton@lemmy.ca on 11 Aug 22:06 collapse

Server. It’s great for automation. SCRU is great because you can set the files by extension and will also auto extract rars. Set it and forget it.

rodsthencones@startrek.website on 12 Aug 00:03 collapse

So that would be just a script in Linux. Bash, the shell for the command line, allows for scripting. Its like a simple program that you can set to run at times. Might take a few tries to get it right, but a little reading and a few tries anyone could get something like that working.

Jack_Burton@lemmy.ca on 12 Aug 00:46 next collapse

That’s awesome thanks. Sounds like a not-too-hard problem I can start learning with!

Jack_Burton@lemmy.ca on 12 Aug 12:24 collapse

Holy shit, so you can pretty much do anything? Like, if I wanted to clone a drive and have it monitored I could learn bash and write a script to, for example, at 2am every day copy all files created yesterday from here to here?

rodsthencones@startrek.website on 12 Aug 14:12 collapse

Sure, that is really the reason for scripting. They are called cron jobs, because they run on a schedule. Its a command called crontab. Unix is all about doing things automatically. Takes a bit of time to set up, but then it does what you want, when you want it. Your going to love it once you use it. Edit: spelling

meekah@lemmy.world on 12 Aug 15:30 collapse

I mean, technically they’re called cron jobs, although the name cron does come from the Greek word chronos.

whimsy@lemmy.zip on 11 Aug 22:32 next collapse

syncthing might also be slightly relevant?

Jack_Burton@lemmy.ca on 12 Aug 12:14 collapse

I’ll add it to look into. Thanks!

tasankovasara@sopuli.xyz on 13 Aug 17:39 collapse

The Linux way:

  • write a script: you can use the find command to find for example rars in a folder. find ~/thatfolder -iname ‘*.rar’ -exec uncompresscommand. Read ‘man find’ for specifics. Script’s first line is #!/bin/bash. Say ‘chmod u+x script’ to make it executable.

  • set up a systemd timer unit that calls a service unit that runs your script at intervals.

  • you can use something like for file in ~/thatfolder/* ; do sed trick that extracts the file extension and puts it in a variable ; case $variable in ; bunch of cases for different extensions. Variable $file will hold the source file name. Read up on bash scripting to figure it out.

Welcome to penguinland :D