Page 1 of 1

Commands Work But Not In Script... " find: invalid number"

Posted: August 5th, 2022, 11:11 am
by chinea
Hi All,

I'm a bit new to this and I have a very simple command line I run to pull files that are greater than 1GB to a different DIR. When I bundle this up into a sh, SAB tells me that the size is incorrect.

Probably more of a Linux question than a SAB one, but does anyone know why?

Code: Select all

#!/bin/bash
find "$1"/ -type f -size +1G -exec mv -f {} /home/downloads/dl \;
From the SAB console: "ScriptExit(1) find: invalid number '1G'"

Again, runs fine if I dump in exactly what SAB is passing to it.

Appreciate your help.

Re: Commands Work But Not In Script...

Posted: August 5th, 2022, 11:31 am
by sander
On what platform exactly?

And: what if you replace +1G with +1000111?

(so size seems to be in kB already, not bytes)

Re: Commands Work But Not In Script... " find: invalid number"

Posted: August 5th, 2022, 1:56 pm
by chinea
Hey Sander. The script is running on ultraseedbox. Let me try what you're suggesting.

Re: Commands Work But Not In Script... " find: invalid number"

Posted: August 5th, 2022, 2:11 pm
by chinea
Well that was embarrassing LOL

Thanks so much. It worked. I'll post up what I did as soon as I get it fine tuned.

Re: Commands Work But Not In Script... " find: invalid number"

Posted: August 5th, 2022, 3:04 pm
by sander
chinea wrote: August 5th, 2022, 1:56 pm Hey Sander. The script is running on ultraseedbox. Let me try what you're suggesting.
Seedboxes ... the gift that keeps on giving ... ;)

Re: Commands Work But Not In Script... " find: invalid number"

Posted: August 5th, 2022, 3:06 pm
by sander
chinea wrote: August 5th, 2022, 2:11 pm Well that was embarrassing LOL

Thanks so much. It worked. I'll post up what I did as soon as I get it fine tuned.
I had googled "find: invalid number" and it was an error message on busybox, which is a lighter-than-light Linux AFAIK. Stuff you use on a router. So ... does your seedbox use (something like) that too?

Re: Commands Work But Not In Script... " find: invalid number"

Posted: August 5th, 2022, 3:20 pm
by OneCD
Yup, it might have a BusyBox version of 'find', with reduced capabilities.