automatic sending

Hello,
I would like some help, I want to send my images to another backup server automatically, but my attempts did not work, follow my script

my orthanc is installed on linux mint the file orthanc.jason is in /etc/orthanc the same directory that I put my script

SCRIPT
function OnStoredInstance(instanceId, tags, metadata, origin)

local remoto = string.lower(metadata[‘DCM4CHEE’])
local paciente = string.lower(tags[‘PatientName’])

–print(“O equipamento”,remoto, “acabou de enviar um exame”)
print(“O equipamento “,remoto,” Acabou de enviar uma imagem”)

– Envia exames de para o node ANDROID
SendToModality(instanceId, ‘DCM4CHEE’)
print("imagem enviada ao node ANDROID nome do paciente ",paciente)
end

ORTHANC.JASON

“LuaScripts” :
[
“/etc/orthanc/remoto.lua”
],

Hello,

Please explain in which way your Lua script doesn’t work, and provide your Orthanc logs in “–verbose” mode:

https://book.orthanc-server.com/users/support.html#discussing-a-minimal-working-example

You can find a full example of Lua auto-routing in the Orthanc Book:
https://book.orthanc-server.com/users/lua.html#auto-routing-of-dicom-images

Sébastien-

hello sebastian
I managed to solve it with this script

function OnStoredInstance(instanceId, tags, metadata)
Delete(SendToModality(instanceId, ‘DCM4CHEE’))
end

thanks for your help