[solved] imapsync flags

Looking to migrate to ZCS? Ask here. Got a great tip or script that helped you migrate? Post it here.
fbzimblet
Advanced member
Advanced member
Posts: 112
Joined: Sun Apr 17, 2016 4:15 pm

[solved] imapsync flags

Postby fbzimblet » Wed Apr 26, 2017 7:38 am

imapsync: 1.727
source: ZCS 7.1.4 CentOS 5
destination: ZCS 8.7.7 CentOS 7

Code: Select all

syncuser.sh: line 7: syntax error near unexpected token `('
syncuser.sh: line 7: `  --regexflag 's/\\\\(?!Answered|Flagged|Deleted|Seen|Recent|Draft)[^\s]*\s*//ig' \'


I got above error with imapsync script as below. Is there something wrong with regex used?

syncuser.sh

Code: Select all

imapsync \
  --maxsize 52428800 --buffersize 8192000 \
  --nofoldersizes --nosyncacls --subscribe --syncinternaldates \
  --authmech2 PLAIN \
  --exclude '(?i)\b(Junk|Spam|Trash)\b' \
  '--skipheader 'X-*' \
  --regexflag 's/\\\\(Answered|Flagged|Deleted|Seen|Recent|Draft)[^\s]*\s*//ig' --debugflags \
  --regextrans2 's,:,-,g' \
  --regextrans2 's,\",'\'',g' \
  --regextrans2 's,\s+(?=/|$),,g' \
  --regextrans2 's,^(Briefcase|Calendar|Contacts|Emailed Contacts|Notebook|Tasks)(?=/|$), $1 Folder,ig' \
  --host1 "$host1" --host2 "$host2" \
  --user1 "$username" --authuser1 admin_account_name \
  --password1 admin_account_password \
  --user2 "$username" --authuser2 admin_account_name \
  --password2 admin_account_password \
  --regextrans2 's,\",-,g' \ # change quotes to dashes
  --regextrans2 's,&AAo-|&AA0ACg-|&AA0ACgANAAo-(?=/|$),,g' \
  --ssl1 --authmech1 PLAIN --maxcommandlength1 16384 \
  --dry --debug --debugimap \ # debug options
Last edited by fbzimblet on Wed May 03, 2017 4:13 am, edited 1 time in total.


fbzimblet
Advanced member
Advanced member
Posts: 112
Joined: Sun Apr 17, 2016 4:15 pm

Re: imapsync flags

Postby fbzimblet » Wed Apr 26, 2017 8:32 am

After I fixed

Code: Select all

'--skipheader 'X-*' \


to

Code: Select all

--skipheader 'X-*' \


I got below error instead. ShellCheck did not show any error. Any idea?

Code: Select all

line 18: --regextrans2: command not found
fbzimblet
Advanced member
Advanced member
Posts: 112
Joined: Sun Apr 17, 2016 4:15 pm

Re: imapsync flags

Postby fbzimblet » Wed May 03, 2017 4:12 am

removing hastags and comments solved this.

Return to “Migration”

Who is online

Users browsing this forum: No registered users and 3 guests