Run `ipfs files cp` right after the `ipfs pin add` is done

On Linux I’m using ipfs-cli to pin large files/folders using this command:
ipfs pin add -r --progress <hash>

When the pinning process is done, I give them a label using this command:
ipfs files cp /ipfs/<hash> /FolderName
The purpose is to have an addressable on the /webui (or IPFS Desktop) of course.

Can you share a way to automate these 2 steps so that the 2nd cmd is run right after the pinning process?

ipfs files cp /ipfs/$(ipfs pin add <CID> | cut -f 2 -d ' ') /FolderName

Hope that helps!

1 Like

Woaa this is dope broo. Imma give this a try

Worked perfectly. Thanks!

1 Like