JeffersonDing / SynologyMerge

A bashscript that moves packages from one Synology NAS volume to another.
Apache License 2.0
37 stars 8 forks source link

issue #2

Open kash1982 opened 3 years ago

kash1982 commented 3 years ago

hi

i get the following when trying to execute the script

/root/migrate.sh: line 7: syntax error near unexpected token newline' /root/migrate.sh: line 7:<!DOCTYPE html>'

wolflarson commented 3 years ago

are you sure you got the script down correctly? I just ran it on 7.0-41890 and did not get that error. I am about to open another issue though :).

wget https://raw.githubusercontent.com/JeffersonDing/SynologyMerge/main/migrate.sh
chmod +x migrate.sh
./migrate.sh -f /volume1 -t /volume5

in my case.

JeffersonDing commented 3 years ago

Seems to be working on my side. Make sure to download the script raw, maybe you copied and pasted the script? Also, make sure you are using bash to run the script, there might be some encoding issues with other shells.

TehDuffman commented 2 years ago

i get the same error message. Running 6.2.3 using the exact same commands as you. Maybe an issue with DSM 6 vs DSM 7

JeffersonDing commented 2 years ago

Yeah, I did write this based on DSM6 and haven't tested it for DSM7 yet. Maybe that's the issue

michealespinola commented 1 year ago

I know this is old, but it can be helpful for other newcomers:

syntax error near unexpected token newline

This typically means that the file was saved in a "Windows-like" CRLF line sequence format. Linux/SSH expects to see LF line sequence format. Re-download the file and/or convert it in a proper text-editor.

ailonag commented 1 year ago

I aslo ran into the same issue when I tried to just run the command below. wget https://github.com/JeffersonDing/SynologyMerge/blob/main/migrate.sh < --Bad using the raw link like @wolflarson suggested worked great and just copying the code and saving it with a text editor work. using the goto file link added a bunch of html for some reason.