You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 9, 2025. It is now read-only.
Confirm there is the moratorium Until "dust box" are deleted. (Default: 2 weeks)
Change the moratorium for confirmation.
Rename "box" name for confirmation.
$ kic burn (dry-run)
Check "box" is not deleted from "warehouse".
$ kic burn indeed
Check "box" has been deleted from "warehouse".
$ cat .kic/config.toml
[burn]
moratorium = "2 weeks"
[sweep]
moratorium = "0 minute"
period = "daily"time = "00:00"
$ kic config set burn.moratorium 1day
INFO: Read "config.toml" file
INFO: Set the parameter for"burn.moratorium"
INFO: Create "config.toml" file
### Rename the directory which has been named as today to yesterday
$ mv .kic/warehouse/2016-05-16/ .kic/warehouse/2016-05-15/
$ kic burn
INFO: Read "config.toml" file
INFO: Get the parameter for"burn.moratorium"
INFO: Create "2016-05-16" directory in".kic/warehouse"
INFO: Create "burn.log" file in".kic/warehouse/2016-05-16"
INFO: Delete expired dusts (dry-run mode)
INFO: =>".kic/warehouse/2016-05-15"
$ tree -a
.
├── .kic
│ ├── config.toml
│ ├── ignore
│ └── warehouse
│ ├── 2016-05-15
│ │ ├── dusts
│ │ │ ├── dir1
│ │ │ │ └── file4
│ │ │ └── file3
│ │ └── sweep.log
│ └── 2016-05-16
│ ├── burn.log
│ └── dusts
├── dir1
│ └── file2
└── file1
8 directories, 8 files
$ kic burn indeed
INFO: Read "config.toml" file
INFO: Get the parameter for"burn.moratorium"
INFO: Create "2016-05-16" directory in".kic/warehouse"
INFO: Create "burn.log" file in".kic/warehouse/2016-05-16"
INFO: Delete expired dusts
INFO: =>".kic/warehouse/2016-05-15"
$ tree -a
.
├── .kic
│ ├── config.toml
│ ├── ignore
│ └── warehouse
│ └── 2016-05-16
│ ├── burn.log
│ └── dusts
├── dir1
│ └── file2
└── file1
5 directories, 5 files
### Action like below is also OK!
$ rm -rf .kic/warehouse/2016-05-16/
Register/Unregister with/from cron
$ kic start
Check several "kic" commands have added to your cron.
Check running time of command in cron change by "config.toml".
$ kic end
Check "kic" commands related to current directory have deleted from your cron.
$ kic start
INFO: Read cron
INFO: Read "config.toml" file
INFO: Get the parameter for"sweep.period"
INFO: Get the parameter for"sweep.time"
INFO: Set new cron
$ crontab -l
#################################### "kic" uses the lines from this.# Please don't touch them and me!###################################
0 12 *** /Users/tokutake/codes/kic/target/debug/kic patrol
0 0 ***cd /Users/tokutake/tmp && /Users/tokutake/codes/kic/target/debug/kic burn indeed
0 0 ***cd /Users/tokutake/tmp && /Users/tokutake/codes/kic/target/debug/kic sweep indeed
#################################### "kic" uses the lines up to here.# Please don't touch them and me!###################################
$ kic config set sweep.period weekly
INFO: Read "config.toml" file
INFO: Set the parameter for"sweep.period"
INFO: Create "config.toml" file
$ kic config set sweep.time 14:00
INFO: Read "config.toml" file
INFO: Set the parameter for"sweep.time"
INFO: Create "config.toml" file
$ kic start
INFO: Read cron
INFO: Read "config.toml" file
INFO: Get the parameter for"sweep.period"
INFO: Get the parameter for"sweep.time"
INFO: Set new cron
$ crontab -l
#################################### "kic" uses the lines from this.# Please don't touch them and me!###################################
0 12 *** /Users/tokutake/codes/kic/target/debug/kic patrol
0 0 ***cd /Users/tokutake/tmp && /Users/tokutake/codes/kic/target/debug/kic burn indeed
0 14 ** 0 cd /Users/tokutake/tmp && /Users/tokutake/codes/kic/target/debug/kic sweep indeed
#################################### "kic" uses the lines up to here.# Please don't touch them and me!###################################
$ kic end
INFO: Read cron
INFO: Set new cron
$ crontab -l
### There is no contents
Add/Delete files or directories to/from "ignore"
Make non-"dust" files.
Add the file to "ignore".
Check the file is not listed.
Make a directory and non-"dust" files in it.
Add the directory to "ignore".
Check the files are not listed.
Delete files in the directory.
Check the empty directory is listed regardless of "ignore".
Add an empty hidden file if you want to leave empty directories.
$ touch file3 file4
$ kic ignore add file3 file4
INFO: Read "ignore" file
INFO: Create "ignore" file
$ kic sweep all
INFO: Create "2016-05-17" directory in".kic/warehouse"
INFO: Create "sweep.log" file in".kic/warehouse/2016-05-17"
INFO: Read "config.toml" file
INFO: Get the parameter for"sweep.moratorium"
INFO: Read "ignore" file
INFO: Move dusts to ".kic/warehouse/2016-05-17/dusts" (dry-run mode)
INFO: Move empty dirs to ".kic/warehouse/2016-05-17/dusts" (dry-run mode)
$ mkdir dir2 && touch dir2/file{5,6}
### If you are leaving "dir1", specifying "dir1" is also OK!
$ kic ignore add dir2
INFO: Read "ignore" file
INFO: Create "ignore" file
$ kic sweep all
INFO: Create "2016-05-17" directory in".kic/warehouse"
INFO: Create "sweep.log" file in".kic/warehouse/2016-05-17"
INFO: Read "config.toml" file
INFO: Get the parameter for"sweep.moratorium"
INFO: Read "ignore" file
INFO: Move dusts to ".kic/warehouse/2016-05-17/dusts" (dry-run mode)
INFO: Move empty dirs to ".kic/warehouse/2016-05-17/dusts" (dry-run mode)
$ rm dir2/*
$ kic sweep all
INFO: Create "2016-05-17" directory in".kic/warehouse"
INFO: Create "sweep.log" file in".kic/warehouse/2016-05-17"
INFO: Read "config.toml" file
INFO: Get the parameter for"sweep.moratorium"
INFO: Read "ignore" file
INFO: Move dusts to ".kic/warehouse/2016-05-17/dusts" (dry-run mode)
INFO: Move empty dirs to ".kic/warehouse/2016-05-17/dusts" (dry-run mode)
INFO: =>"./dir2"
$ touch dir2/.kickeep
$ kic sweep all
INFO: Create "2016-05-17" directory in".kic/warehouse"
INFO: Create "sweep.log" file in".kic/warehouse/2016-05-17"
INFO: Read "config.toml" file
INFO: Get the parameter for"sweep.moratorium"
INFO: Read "ignore" file
INFO: Move dusts to ".kic/warehouse/2016-05-17/dusts" (dry-run mode)
INFO: Move empty dirs to ".kic/warehouse/2016-05-17/dusts" (dry-run mode)
Useful sub-command of "ignore"
Make non-"dust" directories and files.
$ kic ignore current
Check the files are not listed.
Remove non-"dust" files.
$ kic ignore refresh
Check the non-existing files (and directories) have already not existed in "ignore".
$ touch file{5,6,7}
$ mkdir dir3 && dir3/file{8,9,10}
### NOTICE: If you have registered some directories in "ignore", They will be deleted from "ignore" and Files in them will be added to it.
$ kic ignore current
CAUTION: Do you want to preserve current state? [yes/no]: y
INFO: Create "ignore" file
$ kic sweep all
INFO: Create "2016-05-18" directory in".kic/warehouse"
INFO: Create "sweep.log" file in".kic/warehouse/2016-05-18"
INFO: Read "config.toml" file
INFO: Get the parameter for"sweep.moratorium"
INFO: Read "ignore" file
INFO: Move dusts to ".kic/warehouse/2016-05-18/dusts" (dry-run mode)
INFO: Move empty dirs to ".kic/warehouse/2016-05-18/dusts" (dry-run mode)
$ cat .kic/ignore
./dir1/file2
./dir3/file10
./dir3/file8
./dir3/file9
./file1
./file3
./file4
./file5
./file6
./file7
$ rm file{5,6,7}
$ kic ignore refresh
$ cat .kic/ignore
./dir1/file2
./dir3/file10
./dir3/file8
./dir3/file9
./file1
./file3
./file4
Help me!
Check general help message.
Check help message for each command.
$ kic
Usage:
kic <Command>
Description:
Keep your directories clean
Command:
help# Display usage for each command
version # Display the version of this software
init # Register current directory, i.e. create ".kic" directory
config # Change "config.toml" file's contents
ignore # Change "ignore" file's contents
sweep # Move dust files and empty directories into "warehouse" directory
burn # Delete expired directories in "warehouse" directory
start # Start automatic "sweep" and "burn" (UNIX-like: cron, Windows: ?)
end # End automatic "sweep" and "burn" (UNIX-like: cron, Windows: ?)
destroy # Unregister current directory, i.e. delete ".kic" directory
patrol # Keep your "cron" file clean (UNIX-like only)
$ kic help config
Usage:
kic config set<Key><Value>
kic config init
Description:
Change "config.toml" file's contentsCommand: set # Set parameters related to "sweep" and "burn" commands init # Initialize "config.toml" fileKeys: burn.moratorium # Moratorium to delete directories in "warehouse" sweep.moratorium # Moratorium to Move "dust"s into "warehouse" sweep.period # Period to Move "dust"s by automatic "sweep" sweep.time # Time to Move "dust"s by automatic "sweep"
Bye Bye, "kic"!
$ kic destroy
Check contents of cron is deleted if you have left it.
$ kic start
INFO: Read cron
INFO: Read "config.toml" file
INFO: Get the parameter for"sweep.period"
INFO: Get the parameter for"sweep.time"
INFO: Set new cron
$ kic destroy
CAUTION: Do you want to clear all files related to "kic"? [yes/no]: y
INFO: Delete ".kic" directory
INFO: Read cron
INFO: Set new cron
$ crontab -l
### There is no contents