Description
This article explains how to set up recurring uploads to IPFS
Requirements
These steps assume you have an IPFS node running on your local network.
The IPFS daemon service is assumed to be running as the root user.
Steps
This script should be executed on the server running IPFS.
1 | #!/bin/bash |
- The first line uploads the directory to the ipfs server and copies to the ipfs workspace
- The second line removes the pinned items since we have copied them to the ipfs workspace
- The third line removes the local directory
Enter root user session:
1 | $ sudo su - |
Ensure the script is only viewable by the root user and make the script executable,
1 | # chmod 0400 ipfs-backup-script |
As root, edit the crontab
file:
1 | # crontab -e |
Add the following line to the crontab file:
1 | 0 2 * * * /home/<user>/ipfs-backup.sh |
(this will run the ipfs upload at 2am)
When the script completes, the backup should be uploaded to IPFS and the local copy should be deleted.