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

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
chinea
Newbie
Newbie
Posts: 3
Joined: August 5th, 2022, 11:05 am

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

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Commands Work But Not In Script...

Post by sander »

On what platform exactly?

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

(so size seems to be in kB already, not bytes)
chinea
Newbie
Newbie
Posts: 3
Joined: August 5th, 2022, 11:05 am

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

Post by chinea »

Hey Sander. The script is running on ultraseedbox. Let me try what you're suggesting.
chinea
Newbie
Newbie
Posts: 3
Joined: August 5th, 2022, 11:05 am

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

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

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

Post 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 ... ;)
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

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

Post 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?
User avatar
OneCD
Hero Member
Hero Member
Posts: 557
Joined: March 4th, 2017, 3:47 pm

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

Post by OneCD »

Yup, it might have a BusyBox version of 'find', with reduced capabilities.
Stuff I like: Apache bash cron DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo-S20 pfSense Python Raspberry-Pi RAID SABnzbd Transmission Usenet VirtualBox Watcher3 XFCE
Post Reply