Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with awk #2

Closed
earandnow opened this issue Jun 16, 2013 · 8 comments
Closed

error with awk #2

earandnow opened this issue Jun 16, 2013 · 8 comments
Assignees
Labels

Comments

@earandnow
Copy link

Thanks for your reply !

Now i don't have the previous syntax error and the script can connect to the distant ftp server without any problem.

It can also get the list of files to download but each time it fails and i have these erros :

ERROR 02: Download failed and too many retries...

Time spent: 00:00:05

awk: line 1: syntax error at or near *
awk: line 1: syntax error at or near *
awk: line 1: syntax error at or near *
awk: line 1: extra ')'
awk: line 1: syntax error at or near {

Still running it on a debian 7 server...

@crazy-max
Copy link
Owner

I think it's on line 87.
Try to replace this

local destsize=`ls -la "$destfile" | awk '{ print $5}'`

with

local destsize=$(ls -la "$destfile" | awk '{print $5}')

@ghost ghost assigned crazy-max Jun 16, 2013
@earandnow
Copy link
Author

I replaced the line 87 but I still have te same error...

@crazy-max
Copy link
Owner

Can you send the complete logs?

@earandnow
Copy link
Author

Here's the complete log :

root@heisenberg:/home/mikael# /etc/init.d/ftp-sync /home/share/videos

FTP Sync v1.6 (2013/06/18 19:08:33)

Checking connection to ftp://XX.XXX.XXX.XXX:21/done/juin/Series/...

Successfully connected!

Script PID: 13199
Source: ftp://XX.XXX.XXX.XXX:21/done/juin/Series/
Destination: /home/share/videos/
Log file: /etc/ftp-sync/logs/ftp-sync-20130618190833.log

MD5 file: /etc/ftp-sync/ftp-sync.md5

Finding files...

Regex: Game

awk: line 1: syntax error at or near *
awk: line 1: syntax error at or near *
awk: line 1: syntax error at or near *
awk: line 1: extra ')'
awk: line 1: syntax error at or near {
ftpsyncProcess file : Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv
Hash: b2d339372c3ca8ffd341f9de6e842ebc
Size:
Status : Never downloaded...
Start download to /home/share/videos/Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv... Please wait...
ERROR 02: Download failed... retry 1/3
Start download to /home/share/videos/Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv... Please wait...
ERROR 02: Download failed... retry 2/3
Start download to /home/share/videos/Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv... Please wait...
ERROR 02: Download failed... retry 3/3
Start download to /home/share/videos/Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv... Please wait...
ERROR 02: Download failed and too many retries...

Time spent: 00:00:08

awk: line 1: syntax error at or near *
awk: line 1: syntax error at or near *
awk: line 1: syntax error at or near *
awk: line 1: extra ')'
awk: line 1: syntax error at or near {
ftpsyncProcess file : Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.nfo
Hash: 48fc2456cfd62a2cc68c3265ef0eadac
Size:
Status : Never downloaded...
Start download to /home/share/videos/Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.nfo... Please wait...
^CFinished...
Total time spent: 00:00:29

@crazy-max
Copy link
Owner

Can you test these commands :

wget -S --spider --ftp-user="XXX" --ftp-password="XXX" -O - "ftp://XX.XXX.XXX.XXX:21/done/juin/Series/Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv" >&1 2>&1 | grep '^213' | awk '{print $2}'

wget -S --spider --ftp-user="XXX" --ftp-password="XXX" -O - "ftp://XX.XXX.XXX.XXX:21/done/juin/Series/Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv" >&1 2>&1 | grep ' Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv$' | awk '{print $5}'

echo $(awk 'BEGIN{srand();print srand()}')

echo $(date +"%s")

@earandnow
Copy link
Author

here are the results :

wget -S --spider --ftp-user="XXX" --ftp-password="XXX" -O - "ftp://XX.XXX.XXX.XXX:21/done/juin/Series/Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv" >&1 2>&1 | grep '^213' | awk '{print $2}'

1278897989

wget -S --spider --ftp-user="XXX" --ftp-password="XXX" -O - "ftp://XX.XXX.XXX.XXX:21/done/juin/Series/Game_Of_Thrones/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE/Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv" >&1 2>&1 | grep ' Game.of.Thrones.S03E09.720p.HDTV.x264-EVOLVE.mkv$' | awk '{print $5}'

1278897989

echo $(awk 'BEGIN{srand();print srand()}')

1371655013

echo $(date +"%s")

1371655037

@sylk4
Copy link

sylk4 commented Sep 24, 2013

Hi,
I solved the awk issue with changing the awk version. The Debian’s awk does not support 3th argument for match function. Read here :
http://softwaretesttips.com/2012/07/02/sitescope-log-monitor-error-message-awk-line-1-syntax-error-at-or-near/
Maybe this help to fix it.

@crazy-max
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants