1

How do I delete a previously created object in OpenCPU?

I need to delete some unused objects. For example, the result of a POST is the following:

/ocpu/tmp/x0b0f8555a1e1d6/R/.val
/ocpu/tmp/x0b0f8555a1e1d6/stdout
/ocpu/tmp/x0b0f8555a1e1d6/source
/ocpu/tmp/x0b0f8555a1e1d6/console
/ocpu/tmp/x0b0f8555a1e1d6/info
/ocpu/tmp/x0b0f8555a1e1d6/files/DESCRIPTION

How do I delete the object x0b0f8555a1e1d6?

I tried posting to

curl http://myserver:myport/ocpu/library/base/R/rm -d "x0b0f8555a1e1d6"

which gives an error:

... must contain names or character strings

In call:
rm(x0b0f8555a1e1d6 = NA)

And

curl http://myserver:myport/ocpu/library/base/R/rm -d "list='x0b0f8555a1e1d6'"

gives a warning that the object was not found:

object 'x0b0f8555a1e1d6' not found
steora
  • 13
  • 4

1 Answers1

0

The temporary objects automatically get deleted after a while (usually 24h). There is no http API to manually prune them. Have a look at the /etc/cron.d/opencpu script on your server.

If you really want to delete a session you can manually delete the directory in /tmp/ocpu-store/ on your server. It also gets automatically deleted on reboot.

Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207
  • Thanks! I think it would be convenient to have an API to manually delete objects. In my use case, there can be some trial and error before the wanted object is created, and all others created previously can be deleted at that point... – steora Mar 27 '19 at 07:52