How i keep the server running?

Im working in Debian (in a lxc in proxmox).
i start my server like this:
kopia server start --address 0.0.0.0:51515 --server-username=xxxxxxxx@gmail.com --insecure

and is working like a charm, but… how i can leave just running? i mean, without having the terminal occupied with the running server command.

Thanks

wrap it up in systemd unit

I’m not using Linux right now but the way I did similar things in the past was by creating a cronjob that ran on server startup. Very easy to accomplish with Webmin for example.

Yeap. There are always many ways to skin a cat.

thank you.
Im going a little nuts here.

I try several service units from internet.
this last at least works… but… dont works.
I already have connected to a gdrive repository

If i run this in my terminal it works fine:
kopia server start --address 0.0.0.0:51515 --server-username=xxxxxxxxx@gmail.com --insecure --server-password=xxxxxxxx
(actually from the terminal i dont have to put --server-password… and works)

But… if i make my command like that the systemd unit dont work well.

[Unit]
After=network.target

[Service]
User=root
ExecStart=kopia server start --address 0.0.0.0:51515 --server-username=xxxxx@gmail.com --insecure --server-password=xxxxxx

[Install]
WantedBy=default.target

I get this in the journalctl
Apr 18 18:39:22 BASE-DEBIAN-KOPIA kopia[358]: ERROR failed to open repository: cannot open storage: unable to initialize token source: error reading... bla bla... file dont exist

but the file is there in /root

so…?

well… i have it!
when i create the connection to the already existed gdrive repository i make like this:
kopia repository connect gdrive --folder-id 1NdsfadasfDkINwdddddsfsafO12i4zEeUj --credentials-file="kopia-41fadsf-b16dfasffasdf.json"

and that was the fuuuuuuuu… problem for make it work from the systemd service unit.
with

kopia repository connect gdrive --folder-id 1NzsDdsfdsfdasjhdsjhlaf   --credentials-file="/root/kopia-419dfsdsfas.json"

with the complete location of the json file!!!

1 Like