DEV Community

Devon Argent
Devon Argent

Posted on

Day 6: Architecting Project Phoenix β€” Housekeeping & Archiving πŸ“¦

Day 6 of my #1HourADayJourney. Today, I transitioned from basic navigation to acting as a "Digital Architect." In the real world, a database engineer’s job isn't just about SQL; it’s about maintaining a clean, scalable, and secure environment.

πŸ—οΈ Today's Technical Lab: The Architect's Toolkit

I focused on organizing a messy project environment into a professional directory structure and implementing system maintenance.

1. Establishing Directory Hierarchy

Instead of dumping files in the root, I established a standard project structure:

# Creating the structure
mkdir -p src config docs

# Moving files to their designated homes
mv main_app.py src/
mv config.json config/
mv README.md docs/
Enter fullscreen mode Exit fullscreen mode

2. Backup Strategy (Safety First)

Before modifying critical settings, always create a safe copy. This is a life-saver during emergency rollbacks:

# Creating a backup with the .bak extension
cp config.json config/config.json.bak
Enter fullscreen mode Exit fullscreen mode

3. Advanced Archiving with tar

This was the highlight. To manage system logs efficiently, I used tar to bundle and compress outdated files to save disk space:

# Create a compressed archive (c: create, z: gzip, f: file)
tar -czf old_logs.tar.gz *2023*.log

# Removing original files only after verifying the archive
rm *2023*.log
Enter fullscreen mode Exit fullscreen mode

Follow my journey: #1HourADayJourney

Top comments (0)