# Frigate NVR Sync - Optimize Storj TTL

**URL:** <https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354>\
**Category:** Product Discussions\
**Tags:** ttl, rclone\
**Created:** [May 26, 2024, 9:38am UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354 "2024-05-26T09:38:36Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![anto294](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/anto294/32/7831_2.png) [@anto294](https://forum.storj.io/u/anto294)\
**Post date:** [May 26, 2024, 9:38am UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/1 "2024-05-26T09:38:36Z")

</div>

Hi! I recently read that it is possible to set a TTL to keep files only a set period of time, so they would then go straight into the SNO trash without waiting for the GC. Is it already possible to set this?

I use rclone sync in cron.

I am also a SNO as well as a customer. Keeping the network clean is also my duty!

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [May 26, 2024, 10:37am UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/2 "2024-05-26T10:37:21Z")

</div>

Yes, it’s possible, but you need to use either [`uplink` CLI](https://docs.storj.io/dcs/api/uplink-cli/cp-command#copy-a-local-file-into-a-bucket-with-an-expiration-date) or [specify S3 headers](https://docs.storj.io/dcs/buckets/object-lifecycles#setting-object-ttl-in-the-access-grant-s3-credentials).

So, I’m not sure that it’s possible to specify using `rclone`. Perhaps only to [specify it in the access grant](https://docs.storj.io/dcs/buckets/object-lifecycles#setting-object-ttl-in-the-access-grant-s3-credentials).

---

<div class="post-metadata">

**Author:** ![CutieePie](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/cutieepie/32/6440_2.png) [@CutieePie](https://forum.storj.io/u/CutieePie)\
**Post date:** [May 26, 2024, 10:43am UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/3 "2024-05-26T10:43:50Z")

</div>

My mileage with rclone has been limited, the native uplink command is much better.

I believe you can set the access grant that you use, to specify the TTL - so that all files uploaded with that access grant will expire in say 7days, 1 month etc.

From a Frigate point of view, the best option is to hook into the MQTT broker, using something like Mosquito, then hooking that up to Node-Red.

It’s then really easy to watch for certain cameras, or object detection, and fire a native uplink session to upload the object to Storj - Node-red also allows far more advanced object control and manipulation if you want to send emails, or push notifications, switch lights on etc…

I’m sure you are aware, but all the object ID’s used in frigate are stored in a local database, so while syncing the media folder is a good backup - trying to restore from that I’ve never had much luck.

CP

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [May 26, 2024, 10:49am UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/4 "2024-05-26T10:49:10Z")

</div>

You may try to use a TTL limited access grant (or S3 creds based on it) for sync sessions.

---

<div class="post-metadata">

**Author:** ![anto294](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/anto294/32/7831_2.png) [@anto294](https://forum.storj.io/u/anto294)\
**Post date:** [May 26, 2024, 11:30am UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/5 "2024-05-26T11:30:20Z")

</div>

I sync media and DB.  
The recordings are always in a hdd. Backup is for added security.  
After numerous tests, it is enough to do a reverse “Rclone copy” to have everything working perfectly.

---

<div class="post-metadata">

**Author:** ![anto294](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/anto294/32/7831_2.png) [@anto294](https://forum.storj.io/u/anto294)\
**Post date:** [May 26, 2024, 11:33am UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/6 "2024-05-26T11:33:26Z")

</div>

> rclone copy storj-tree.png storj:my-bucket --header-upload “x-amz-meta-object-expires:+5m”

It should be fine!

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [May 26, 2024, 12:33pm UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/7 "2024-05-26T12:33:57Z")

</div>

Wow! Thank you! I didn’t know, that you may submit an additional headers like this!

But I believe that it works only if you would use an S3 integration.

---

<div class="post-metadata">

**Author:** ![anto294](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/anto294/32/7831_2.png) [@anto294](https://forum.storj.io/u/anto294)\
**Post date:** [May 26, 2024, 2:27pm UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/8 "2024-05-26T14:27:06Z")

</div>

If it is configured as S3 compatible, yes, no problem!  
I will also try out the native rclone integration out of curiosity.

I take the opportunity to ask a question: At what point is s3 object versioning? I would like to have only 3 versions, with each version retain at 30 days (noncurrentversion equivalent of aws s3)

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [May 26, 2024, 2:39pm UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/9 "2024-05-26T14:39:02Z")

</div>

The native is usually better if you have more than 1Gbit for the upstream.

> [@anto294](#):
>
> At what point is s3 object versioning?

What about right now?

> **[Object Versioning in Storj - Storj Docs](https://docs.storj.io/dcs/buckets/object-versioning)**
>
> Detailed guide on enabling object versioning for buckets

---

<div class="post-metadata">

**Author:** ![anto294](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/anto294/32/7831_2.png) [@anto294](https://forum.storj.io/u/anto294)\
**Post date:** [May 26, 2024, 3:00pm UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/10 "2024-05-26T15:00:05Z")

</div>

Yes, but what I am looking for seems not yet to be implemented.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [May 26, 2024, 3:09pm UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/11 "2024-05-26T15:09:00Z")

</div>

And what’s are you searching for?  
Immutable storage, like this:

> **[Understanding Data Immutability in Object Storage - Storj Docs](https://docs.storj.io/learn/concepts/immutability)**
>
> The post discusses the concept of immutability in data storage and how Storj implements this concept to ensure secure and unquestionable data preservation.

or

> <https://github.com/storj/roadmap/issues/98>
>
> \### Summary
> Our current implementation of S3 Compatible Object Lock only account…s for Compliance Mode. This roadmap item is meant to cover the remaining functionality to complete full Object Lock compatibility.
> 
> \#### New operations to support
> 
> \- PutObjectLockConfiguration
> - ObjectLockEnabled: Indicates whether this bucket has an Object Lock configuration enabled. Enable \`ObjectLockEnabled\` when you apply \`ObjectLockConfiguration\` to a bucket.
> - Rule: Specifies the Object Lock rule for the specified object. Enable the this rule when you apply \`ObjectLockConfiguration\` to a bucket. Bucket settings require both a mode and a period. The period can be either \`Days\` or \`Years\` but you must select one. You cannot specify \`Days\` and \`Years\` at the same time.
> \- GetObjectLegalHold
> \- PutObjectLegalHold
> 
> \#### Existing operations to update
> \- PutObject
> - Should support the following request params:
> - \`x-amz-object-lock-mode\` (\`GOVERNANCE\` should be added)
> - \`x-amz-object-lock-legal-hold\`
> \- GetObjectLockConfiguration
> - Should return any \`Rule\` that has been applied via \`PutObjectLockConfiguration\`
> \- GetObjectRetention
> - Should now also return mode of \`GOVERNANCE\` for objects locked with Governance Mode
> \- PutObjectRetention
> - Should support the following request params:
> - \`x-amz-bypass-governance-retention\`
> - Should accept \`GOVERNANCE\` Mode
> 
> TBD on filling these out:
> \- CreateBucket
> \- HeadObject
> \- GetObject
> \- PutObject
> \- FinishMoveObject
> \- CopyObject
> \- DeleteBucket
> \- DeleteObjectVersion
> 
> \#### New permissions/access to consider
> | S3 Permission | Description | Notes |
> |---|---|---|
> | s3:BypassGovernanceRetention | Grants permission to allow circumvention of governance-mode object retention settings | Notes on how this permission is utilized/how it works: \[Object Lock considerations - Amazon Simple Storage Service\](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-managing-bypass) |
> | s3:PutBucketObjectLockConfiguration | Grants permission to put Object Lock configuration on a specific bucket. | |
> | s3:GetObjectLegalHold | Grants permission to get an object's current Legal Hold status | |
> | s3:PutObjectLegalHold | Grants permission to apply a Legal Hold configuration to the specified object | |

---

<div class="post-metadata">

**Author:** ![anto294](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/anto294/32/7831_2.png) [@anto294](https://forum.storj.io/u/anto294)\
**Post date:** [May 26, 2024, 3:22pm UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/12 "2024-05-26T15:22:04Z")

</div>

Lifecycle rules for versioned objects:

I want to:

- Keep the current version indefinitely ✅
- If it is modified I want to keep the versions ✅
- Keep only the last 3 non current version
- Eliminare le versioni non correnti dopo 30 giorni

---

<div class="post-metadata">

**Author:** ![anto294](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/anto294/32/7831_2.png) [@anto294](https://forum.storj.io/u/anto294)\
**Post date:** [May 26, 2024, 3:23pm UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/13 "2024-05-26T15:23:08Z")

</div>

Nope, I’ve been following the roadmap for a year, and was hoping for the recent sprint

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [May 26, 2024, 3:35pm UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/14 "2024-05-26T15:35:02Z")

</div>

You always can delete versions. Seems I do not get a problem…

---

<div class="post-metadata">

**Author:** ![anto294](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/anto294/32/7831_2.png) [@anto294](https://forum.storj.io/u/anto294)\
**Post date:** [May 26, 2024, 3:39pm UTC](https://forum.storj.io/t/frigate-nvr-sync-optimize-storj-ttl/26354/15 "2024-05-26T15:39:58Z")

</div>

I would have liked an automatic way!  
The most powerful weapon against ransomware is zfs snapshot + s3 versioning
