This article explains how to set up recurring uploads to IPFS
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.
This script should be executed on the server running IPFS.
- 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:
$ sudo su -
Ensure the script is only viewable by the root user and make the script executable,
# chmod 0400 ipfs-backup-script
As root, edit the
# crontab -e
Add the following line to the crontab file:
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.