sexta-feira, 22 de outubro de 2021

linux

nano /etc/systemd/system/vnc.service [Unit] Description = X11VNC pre-login After = multi-user.target [Service] Type = simple ExecStart = /usr/bin/x11vnc -ncache 10 -auth guess -nap -forever -loop -repeat -rfbauth /root/.vnc/passwd -rfbport 5900 [Install] WantedBy = multi-user.target Then to activate the systemd service: systemctl daemon-reload Then to enable the service on boot: systemctl enable vnc Then reboot, and it should come up on its own. shutdown -r now


For example, if we wanted to have the system date written in a file called date.txt when Linux restarts, we would add the following string:

@reboot date >> ~/date.txt

If we wanted to run the backup shell at reboot, we would add:

@reboot /root/backup.sh



 Note: In some cases, the crond service needs to be enabled on boot for the configuration to function.

To check if the crond service is enabled, use:

sudo systemctl status cron.service

To enable this service, use:

sudo systemctl enable cron.service

Nenhum comentário:

Postar um comentário

interface python