Help for a bash script or rsync or? (file copy via cron job)

Hello!

I have a problem and hope that I can find help here :wink:
It’s about the certificates from LetsEncrypt.

These are stored in etc / letsencrypt / archive and always given an ascending number.
In the / etc / letsencrypt / live directory there is only the sym link to the currently valid certificate.

I would like to use a cron job to regularly copy three files from one directory to another network drive (nfs / cifs).

How does a bash script have to look like, does anyone have something like that?

many greetings

Gerald

That would be my idea to solve the problem:

rsync -rtul /etc/letsencrypt/ root@192.168.144.110:/backup/letsencrypt

However, it does not always work, without recognizable errors, ewr does not do it regularly.

Gerald

I thought you only wanted to copy the three files–so cp /etc/letsencrypt/live/{YOUR_FQDN}/*.pem /some/other/path would do the trick. It would get four files, so one would be superfluous, but it would seem to get what you need.

1 Like