-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup: Integrate expired files periodic cleanup
- Loading branch information
1 parent
bc599ae
commit 151515f
Showing
8 changed files
with
75 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
linx-cleanup | ||
------------------------- | ||
When files expire, access is disabled immediately, but the files and metadata | ||
will persist on disk until someone attempts to access them. | ||
|
||
If you'd like to automatically clean up files that have expired, you can use the included `linx-cleanup` utility. To run it automatically, use a cronjob or similar type | ||
of scheduled task. | ||
|
||
You should be careful to ensure that only one instance of `linx-cleanup` runs at | ||
a time to avoid unexpected behavior. It does not implement any type of locking. | ||
|
||
|
||
|Option|Description | ||
|------|----------- | ||
| ```-filespath files/``` | Path to stored uploads (default is files/) | ||
| ```-nologs``` | (optionally) disable deletion logs in stdout | ||
| ```-metapath meta/``` | Path to stored information about uploads (default is meta/) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
|
||
"github.com/andreimarcu/linx-server/cleanup" | ||
) | ||
|
||
func main() { | ||
var filesDir string | ||
var metaDir string | ||
var noLogs bool | ||
|
||
flag.StringVar(&filesDir, "filespath", "files/", | ||
"path to files directory") | ||
flag.StringVar(&metaDir, "metapath", "meta/", | ||
"path to metadata directory") | ||
flag.BoolVar(&noLogs, "nologs", false, | ||
"don't log deleted files") | ||
flag.Parse() | ||
|
||
cleanup.Cleanup(filesDir, metaDir, noLogs) | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters