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/
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
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
Follow my journey: #1HourADayJourney
Top comments (0)