Search Results

Search: Posts Made By: dufftime
10,424
Posted By dufftime
Your code worked for me
I copy/pasted your code snippet into a new bash script, changed the username, password, testfile, and FTP server, then it ran just fine.

Try changing the first line to:
#!/bin/bash -xv

You can...
4,618
Posted By dufftime
"Not connected" probably means you can't connect
Just break your FTP batch file into steps and run them one by one. Try:

$ ftp <ipaddress>

I suspect you're getting blocked... maybe bad IP or firewall.

If you get a login prompt, then...
6
2,223
Posted By dufftime
Escape your double-quotes, or just avoid wrapping...
Escape your double-quotes, or just avoid wrapping double-quotes around your "echo" command ... they technically aren't required.

Shell sees you opening your quote after the echo, then assumes you...
4,892
Posted By dufftime
Use 'stat' instead
man stat

You can use either "stat -c %y" for a better format (might still need some parsing, but closer to what you want), or you may even want to store the time in epoch time, using "stat -c %Y"...
5,773
Posted By dufftime
Can't you just check for "$?" ?
'mv' (as well as almost every UNIX command or script) will return 0 if it succeeds, which should end up in the shell variable "$?".

You can also look into using the "||" operand to execute...
45,080
Posted By dufftime
Sounds like you need HTTP POST's
I recently wrote a script to simulate some web transactions recently (not too different than yours), I had good luck following this tip from curl's website...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 04:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy