Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Usage of ./expiredis:
Set a TTL of 3600 (1 hour) for all keys without a TTL, processing 1000 keys at a time

```bash
expiredis -limit -1 -count 1000 -set-ttl 3600
expiredis -limit -1 -count 1000 -set-ttl 3600 -dry-run=false
```

Delete all keys matching `foo:*`
```bash
expiredis -limit -1 -pattern "foo:*" -delete
expiredis -limit -1 -pattern "foo:*" -delete -dry-run=false
```

Reduce expiry by 86400 seconds of keys matching `bar:*` with a minimum TTL of 86400 (1 day)
```bash
expiredis -limit -1 -pattern "bar:*" -subtract-ttl 86400
expiredis -limit -1 -pattern "bar:*" -subtract-ttl 86400 -dry-run=false
```
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func main() {
fs := flag.NewFlagSetWithEnvPrefix(NAME, strings.ToUpper(NAME), flag.ExitOnError)

fs.BoolVar(&verbose, "verbose", false, "debug logging")
fs.BoolVar(&dryRun, "dry-run", false, "dry run, no destructive commands")
fs.BoolVar(&dryRun, "dry-run", true, "dry run, no destructive commands")
fs.StringVar(&url, "url", "redis://", "URI of Redis server (https://www.iana.org/assignments/uri-schemes/prov/redis)")
fs.StringVar(&pattern, "pattern", "*", "Pattern of keys to process")
fs.IntVar(&limit, "limit", 100, "Maximum number keys to process")
Expand Down