Errors in command-line arguments:

Hi,

Below error during archive the table data , Please look into this and provide a solution

[root@DELGEMIDACRMDB1UAT dump]# pt-archiver --source h=localhost,u=,p='',D=bid_draft_testing31082024,t=bid_item_consignee --where ‘bic_bid_id in (select b_id from bids join bid_attributes on b_id = ba_bid_id where ba_created_on <= ‘2024-02-08 00:00:00’ and b_status=0)’ --no-check-charset --limit=5000 --commit-each --file /dump/%Y-%m-%d-%D.%t 2>> /dump/arch.err
Usage: pt-archiver [OPTIONS] --source DSN --where WHERE

Errors in command-line arguments:

  • Unrecognized command-line options 00:00:00 and b_status=0)

pt-archiver nibbles records from a MySQL table. The --source and --dest
arguments use DSN syntax; if COPY is yes, --dest defaults to the key’s value
from --source. For more details, please use the --help option, or try ‘perldoc
/usr/bin/pt-archiver’ for complete documentation.

Thanks
Sumit Kumar

Seems your where clause does not have proper quotations.
It would help if you tried something like this

pt-archiver --source h=localhost,u=root,D=bid_draft_testing31082024,t=bid_item_consignee --ask-pass \
--where "bic_bid_id IN (SELECT b_id FROM bids JOIN bid_attributes ON b_id = ba_bid_id WHERE ba_created_on <= '2024-02-08 00:00:00' AND b_status=0)" \
--no-check-charset --limit=5000 --commit-each --file '/dump/%Y-%m-%d-%D.%t'  --dry-run2>> /dump/arch.err

There is --ask-pass option if you want to provide a password in command line.

You can also add --dry-run to test if the command is good.
To execute just remove --dry-run