DEV Community

Bobo
Bobo

Posted on

Automate Your File Organization with One Command Every Day

Automate Your File Organization with One Command Every Day

Your Downloads folder is overflowing. Your Desktop is a mess. Your backup drive has 47 copies of the same file. Let's fix this forever.

Install

npm install -g file-batch-toolkit
Enter fullscreen mode Exit fullscreen mode

The Daily Cleanup Command

file-batch-toolkit organize ~/Downloads/
file-batch-toolkit deduplicate ~/Documents/backups/ --auto-delete
Enter fullscreen mode Exit fullscreen mode

Set Up Automation

Windows Task Scheduler

# Create a daily scheduled task
$action = New-ScheduledTaskAction -Execute "file-batch-toolkit" -Argument "organize ~/Downloads/"
$trigger = New-ScheduledTaskTrigger -Daily -At 8am
Register-ScheduledTask -TaskName "Daily Cleanup" -Action $action -Trigger $trigger
Enter fullscreen mode Exit fullscreen mode

Linux/Mac Cron

# crontab -e
0 8 * * * file-batch-toolkit organize ~/Downloads/ && file-batch-toolkit deduplicate ~/Downloads/ --auto-delete
Enter fullscreen mode Exit fullscreen mode

Organize by Custom Rules

# Organize with custom folder structure
file-batch-toolkit organize ./mess/ --rules images:Images,documents:PDFs,videos:Media
Enter fullscreen mode Exit fullscreen mode

Install

npm install -g file-batch-toolkit
Enter fullscreen mode Exit fullscreen mode

🌐 Visit us: https://www.tucaowall.vip/
☁️ Get free DigitalOcean credit: https://m.do.co/c/fc5cb7b29a0d

How do you keep your files organized? Share your tips!

Top comments (0)