# seem the pt-archiver where condition cannot including space

**URL:** <https://forums.percona.com/t/seem-the-pt-archiver-where-condition-cannot-including-space/4514>\
**Category:** Percona Toolkit\
**Created:** [November 12, 2015, 10:32am UTC](https://forums.percona.com/t/seem-the-pt-archiver-where-condition-cannot-including-space/4514 "2015-11-12T10:32:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CharlieCao](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@CharlieCao](https://forums.percona.com/u/CharlieCao)\
**Post date:** [November 12, 2015, 10:32am UTC](https://forums.percona.com/t/seem-the-pt-archiver-where-condition-cannot-including-space/4514/1 "2015-11-12T10:32:37Z")

</div>

seem the pt-archiver where condition cannot including space  
have tried this condition and show me the an error

–where delete\_timestamp \< ADDDATE(LAST\_DAY(SUBDATE(now(), INTERVAL 3 MONTH)), 1)

Usage: pt-archiver [OPTIONS] --source DSN --where WHERE

Errors in command-line arguments:

- Unrecognized command-line options \< ADDDATE(LAST\_DAY(SUBDATE(now(), INTERVAL 3 MONTH)), 1)

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  
/opt/mysqlapp/PerconaTool/percona-toolkit-2.2.16/bin/pt-archiver’ for complete  
documentation.

But, If change the condition under will work

–where delete\_timestamp \< ADDDATE(LAST\_DAY(SUBDATE(now(),90)), 1)

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [November 12, 2015, 1:39pm UTC](https://forums.percona.com/t/seem-the-pt-archiver-where-condition-cannot-including-space/4514/2 "2015-11-12T13:39:52Z")

</div>

Hi CharlieCao;

Try putting quotations around it:

–where “delete\_timestamp \< ADDDATE(LAST\_DAY(SUBDATE(now(), INTERVAL 3 MONTH)), 1)”

-Scott

---

<div class="post-metadata">

**Author:** ![CharlieCao](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@CharlieCao](https://forums.percona.com/u/CharlieCao)\
**Post date:** [November 16, 2015, 2:46pm UTC](https://forums.percona.com/t/seem-the-pt-archiver-where-condition-cannot-including-space/4514/3 "2015-11-16T14:46:04Z")

</div>

Hi Scott,  
I tried what your suggestion using quote in where condition but, got same issue:

306 --dry-run --where “delete\_timestamp \< ADDDATE(LAST\_DAY(SUBDATE(now(),interval 3 month)), 1)”  
Usage: pt-archiver [OPTIONS] --source DSN --where WHERE

Errors in command-line arguments:

- Unrecognized command-line options \< ADDDATE(LAST\_DAY(SUBDATE(now(),interval 3 month)), 1)"

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  
/opt/mysqlapp/PerconaTool/percona-toolkit-2.2.16/bin/pt-archiver’ for complete  
documentation.

---

<div class="post-metadata">

**Author:** ![CharlieCao](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@CharlieCao](https://forums.percona.com/u/CharlieCao)\
**Post date:** [November 16, 2015, 3:11pm UTC](https://forums.percona.com/t/seem-the-pt-archiver-where-condition-cannot-including-space/4514/4 "2015-11-16T15:11:30Z")

</div>

en, add the quote do solved the problem. but I still have an issue to write into shell script. that’s should be fine at least which is working manual write the command line.  
Thanks Scott for your help!
