I do my backups with rsnapshot which creates a lockfile with the process pid inside. Now I would like to make a backup from the rsnapshots backup, so I´m looking for a way to create this lockfile for the second/external backup.
The shell script should like this:
How can I get the PID and save it as a rsnapshot lockfile ?
The PID is stored in $$
Like
echo $$ > thisscriptpidfile