Solved Backup BASH Script error

September 28, 2016 at 00:55:33
Specs: Windows 7
Why I can't get this script working?

http://alex.boyne-aitken.co.uk/2009...

I followed instructions but get all of time error:

ECHO ERROR: Settings file not found!

That "IF EXIST %~f1 GOTO labelBegin" is my problem.


See More: Backup BASH Script error

Reply ↓  Report •


#1
September 28, 2016 at 05:17:15
Well, for one, that isn't a bash script. It's a batch script.

How To Ask Questions The Smart Way


Reply ↓  Report •

#2
September 29, 2016 at 04:37:04
✔ Best Answer
If you are on a Windows computer, and you mean batch (not bash), you're most likely not passing the correct argument. It is supposed to be a path leading to a settings file. It normally will give you the error if the file does not exist, but if the argument isn't a path or file at all, it will also give you an error.
script.bat "C:\Path\To\Settings_file.txt"

You can also enclose %~f1 in quotes.

%~f1

"%~f1"

If you're on Linux or anything else that uses bash, you can't use this script.

Don't worry if plan A fails, there are 25 more letters in the alphabet ;)

message edited by RainBawZ


Reply ↓  Report •

#3
September 30, 2016 at 17:56:03
Did you supply argument #1 (the settings filename, including fully qualified path)? Running from command-prompt or from explorer? (I highly recommend command-prompt, but that's just my prejudice, or fix the script so you don't need to "drag and drop"). Everything else Rainbawz has already covered.

message edited by nbrane


Reply ↓  Report •

Related Solutions


Ask Question