# Can i safely cancel pt-archiver which is running for last 20+ hours

**URL:** <https://forums.percona.com/t/can-i-safely-cancel-pt-archiver-which-is-running-for-last-20-hours/6597>\
**Category:** Percona Toolkit\
**Created:** [September 26, 2018, 10:23pm UTC](https://forums.percona.com/t/can-i-safely-cancel-pt-archiver-which-is-running-for-last-20-hours/6597 "2018-09-26T22:23:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashoknix](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ashoknix](https://forums.percona.com/u/ashoknix)\
**Post date:** [September 26, 2018, 10:23pm UTC](https://forums.percona.com/t/can-i-safely-cancel-pt-archiver-which-is-running-for-last-20-hours/6597/1 "2018-09-26T22:23:16Z")

</div>

Hello,

I have started this to delete rows… It is running for last 20+ hours

pt-archiver --source h=localhost,D=XXX,t=ory\_uint --purge --where “clock \< ‘1527724800’” --purge --no-check-columns --no-check-charset --limit=1 --commit-each --statistics --progress=100

I would like to stop it.

Please advise.

Thank You!

---

<div class="post-metadata">

**Author:** ![carlos.salguero](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/carlos.salguero/32/20_2.png) [@carlos.salguero](https://forums.percona.com/u/carlos.salguero)\
**Post date:** [September 27, 2018, 4:58am UTC](https://forums.percona.com/t/can-i-safely-cancel-pt-archiver-which-is-running-for-last-20-hours/6597/2 "2018-09-27T04:58:21Z")

</div>

Hello,

You can stop ip since pt-archiver will try to catch the termination signal.  
From the documentation: [https://www.percona.com/doc/percona-toolkit/LATEST/pt-archiver.html#error-handling](https://www.percona.com/doc/percona-toolkit/LATEST/pt-archiver.html#error-handling)

> [@](#):
>
> ERROR-HANDLING  
> pt-archiver tries to catch signals and exit gracefully; for example, if you send it SIGTERM (Ctrl-C on UNIX-ish systems), it will catch the signal, print a message about the signal, and exit fairly normally. It will not execute --analyze or --optimize, because these may take a long time to finish. It will run all other code normally, including calling after\_finish() on any plugins (see “EXTENDING”).
> 
> In other words, a signal, if caught, will break out of the main archiving loop and skip optimize/analyze.

Regards

---

<div class="post-metadata">

**Author:** ![ashoknix](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ashoknix](https://forums.percona.com/u/ashoknix)\
**Post date:** [September 27, 2018, 6:36am UTC](https://forums.percona.com/t/can-i-safely-cancel-pt-archiver-which-is-running-for-last-20-hours/6597/3 "2018-09-27T06:36:01Z")

</div>

Thank you Carlos!

I read through the link.

From the pt-archiver - i see it so far it completed x M rows - So, when I cancel it via ctrl+c - does the pt-archiver deleted those rows that matched till ctrl+c ?

---

<div class="post-metadata">

**Author:** ![carlos.salguero](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/carlos.salguero/32/20_2.png) [@carlos.salguero](https://forums.percona.com/u/carlos.salguero)\
**Post date:** [September 27, 2018, 6:55am UTC](https://forums.percona.com/t/can-i-safely-cancel-pt-archiver-which-is-running-for-last-20-hours/6597/4 "2018-09-27T06:55:06Z")

</div>

Yes, it will try to do a clean break.

---

<div class="post-metadata">

**Author:** ![ashoknix](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ashoknix](https://forums.percona.com/u/ashoknix)\
**Post date:** [September 27, 2018, 9:02am UTC](https://forums.percona.com/t/can-i-safely-cancel-pt-archiver-which-is-running-for-last-20-hours/6597/5 "2018-09-27T09:02:28Z")

</div>

ok thank you!

---

<div class="post-metadata">

**Author:** ![Milind](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Milind](https://forums.percona.com/u/Milind)\
**Post date:** [June 4, 2020, 3:00am UTC](https://forums.percona.com/t/can-i-safely-cancel-pt-archiver-which-is-running-for-last-20-hours/6597/6 "2020-06-04T03:00:48Z")

</div>

HI Carlos,&nbsp;  
Based on your comments. Actually i need to know if pt-archiver can wait if the source tables have any queries running on it then it let them complete and that and then it runs again.&nbsp;  
  
pt-archiver --source h=127.0.0.1,P=3306,D= **,t=tbl1,u=** \*\*_,p=\*\*\*\*\*\*\*\* --where "LAST\_UPD\_DT \> ‘2018-06-02’ " --dest h=127.0.0.1,P=3306,u= **,p=** _,D=\*\*\*\*\*,t=tbl2–limit=50000 --ignore --progress 100000 --no-delete --max-lag=300s --sleep=1 --statistics  
  
so here if tbl1 has some bulk DMLs running on it for few hours then will it wait till the those transactions are complete or will it come out.&nbsp;  
  
Also if I use --retries=100 or 1000 then will it try restarting the copy or will it fail?
