Back

[SOLVED] Cron job

  • 0
  • Self Hosted
  • Databases
ozonko89
18 Jul, 2023, 12:10

I would like to find a way to accomplish the following: Once a day a job should be executed that moves all documents older than 30 days from one collection to another collection and deletes personal user data. Is there a way to do this with an appwrite function? Or has anyone ever done something similar?

TL;DR
The user is asking if rate limiting is an issue when running a function in the Appwrite instance. The solution suggested is to install the Appwrite Docker instance or test the function in the Appwrite cloud. The user is also advised to use the Appwrite server or the Appwrite CLI for testing. Lastly, the user asks if it's possible to execute a daily job using an Appwrite function to move documents and delete user data, to which a solution is not provided in the thread.
ilikechicken77
18 Jul, 2023, 12:11

yes you can set cron schedules for functions pretty easily from the console

ilikechicken77
18 Jul, 2023, 12:12
ilikechicken77
18 Jul, 2023, 12:12
ozonko89
18 Jul, 2023, 12:15

So the correct way would be to first write a function locally and test it with the appwrite-cli and then install the function on the appwrite server, which then executes this function via cron execution?

D5
18 Jul, 2023, 12:20

Yes

D5
18 Jul, 2023, 12:21

Well, with appwrte CLI you can't test it, just deploy

D5
18 Jul, 2023, 12:21

So you will need to test in the server. You could use a separate instance (for example a local instance)

ozonko89
18 Jul, 2023, 12:22

Ok but i can test it then with the server "node-appwrite" package.

D5
18 Jul, 2023, 12:22

Sorry, what do you mean?

ozonko89
18 Jul, 2023, 12:23

My Aplication Server with the appwrtite node Package installed

D5
18 Jul, 2023, 12:24

Appwrite uses a different way/template, so I recommend testing it directly in an Appwrite instance (it could be a local one in your computer)

D5
18 Jul, 2023, 12:25

Or you could use Appwrite cloud

ozonko89
18 Jul, 2023, 12:25

Ok i should install appwrite Docker instanz and test the function there

ozonko89
18 Jul, 2023, 12:26

Sorry one more question: Is rate limiting any problem when the function is running in the Appwrite instanz?

D5
18 Jul, 2023, 12:32

I think not

ozonko89
18 Jul, 2023, 12:34

Ok Thank you very much and have a nice day

Drake
19 Jul, 2023, 00:13

[SOLVED] Cron job

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more