DEV Community

Cover image for πŸ“¦ My DevOps Journey: Part 4 β€” Archiving, Scheduling, Remote Access & System Administration Essentials
Sheersh Sinha
Sheersh Sinha

Posted on

πŸ“¦ My DevOps Journey: Part 4 β€” Archiving, Scheduling, Remote Access & System Administration Essentials

After learning about permissions, ownership, and package managers in Part 3, I realized that being comfortable with Linux also means being able to manage files, automate tasks, secure access, and work across systems.

This part of my journey dives into some of the most practical everyday tools of a DevOps engineer: archiving, cronjobs, SSH, SCP, virtual machines, and key pairs.

πŸ“‚Archiving & Compression

One of my first real struggles was handling log backups. I had thousands of log files in /var/log/, and transferring them individually was a nightmare.

So I used tar:

tar -cvf logs.tar /var/log/
Enter fullscreen mode Exit fullscreen mode

Output:

/var/log/syslog
/var/log/auth.log
/var/log/kern.log
...
Enter fullscreen mode Exit fullscreen mode

Later, to extract:

tar -xvf logs.tar
Enter fullscreen mode Exit fullscreen mode

Then I tried compressing a single file:

gzip demo.txt
Enter fullscreen mode Exit fullscreen mode

Output:

demo.txt β†’ demo.txt.gz
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ Lesson: Instead of moving hundreds of files, I just tar them into one archive, transfer, and extract. Much cleaner.

⏰ Automating Tasks with Cronjobs

I hated repeating backups manually, so I created a cronjob.

crontab -e
Enter fullscreen mode Exit fullscreen mode

I added:

0 0 * * * /home/user/backup.sh
Enter fullscreen mode Exit fullscreen mode

To check:

crontab -l
Enter fullscreen mode Exit fullscreen mode

Output:

0 0 * * * /home/user/backup.sh
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ Troubleshooting: At first, my cronjob didn’t run. The issue? My script used python3, but cron didn’t recognize it. I fixed it by giving the full path:

/usr/bin/python3 /home/user/backup.py

Enter fullscreen mode Exit fullscreen mode

πŸ” Security & System Administration Basics

Next, I explored system security.

Creating a new user:

sudo adduser dev
Enter fullscreen mode Exit fullscreen mode

Output:

Adding user `dev' ...
Adding new group `dev' (1002) ...
Creating home directory `/home/dev' ...

Enter fullscreen mode Exit fullscreen mode

Giving sudo rights:

sudo usermod -aG sudo dev

Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ Lesson: I once mistakenly gave a developer sudo rights when he only needed file access. It taught me that least privilege is key in production.

🌐 Remote Connections with SSH

When I first tried logging into a server:

ssh user@192.168.1.10
Enter fullscreen mode Exit fullscreen mode

It asked for a password β€” fine. But when I disabled password login, I hit this error:

Permission denied (publickey).
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ The fix was to use SSH key pairs.

πŸ”‘ Generating SSH Key Pairs

I generated a key:

ssh-keygen -t rsa -b 4096 -C "sheershsinha30@gmail.com"
Enter fullscreen mode Exit fullscreen mode

Output:

Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):

Enter fullscreen mode Exit fullscreen mode

Then copied it to the server:

ssh-copy-id user@192.168.1.10

Enter fullscreen mode Exit fullscreen mode

Now login works without typing a password:

ssh user@192.168.1.10

Enter fullscreen mode Exit fullscreen mode

πŸ’» Creating Virtual Machines

  • Before trying things on production servers, I practiced on VirtualBox:
  • Created a VM with Ubuntu.
  • Configured NAT networking.
  • Installed nginx inside the VM:
sudo apt install nginx -y

Enter fullscreen mode Exit fullscreen mode

Verified:

systemctl status nginx
Enter fullscreen mode Exit fullscreen mode

Output:

nginx.service - A high performance web server and a reverse proxy server
   Active: active (running)
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ Lesson: Breaking things in a VM is safe β€” I just reverted to a snapshot.

🌟 Key Takeaways from Part 4

  • Archiving makes backups portable.
  • Cronjobs automate repetitive tasks.
  • System security is about principle of least privilege.
  • SSH & SCP are lifelines for remote management.
  • SSH key pairs enable passwordless secure automation.
  • Virtual machines provide a safe DevOps sandbox.

πŸš€ What’s Next (Part 5: Shell Scripting)

After learning permissions, automation, and SSH, I realized that typing commands again and again isn’t efficient. That’s where Shell Scripting comes in β€” the real glue of DevOps.

In the next part of my journey, I’ll cover:

  • 🐚 Introduction to Shell Scripting β€” Why scripts matter in DevOps.
  • ✍️ Write & execute a simple script β€” Going from one-liners to automation.
  • πŸ“¦ Variables & Operators β€” Storing values and doing calculations.
  • πŸ‘€ Read user input β€” Making scripts interactive.
  • πŸ”„ Functions & Loops β€” Reusing and repeating code smartly.
  • ⚑ Shell vs sh vs Bash β€” What’s the difference?
  • πŸ“ How to write Bash scripts β€” Best practices for real-world use.
  • πŸ€” Conditional Statements β€” Adding logic to decisions.
  • πŸ“₯ Passing Arguments to a Script β€” Making scripts flexible and reusable.

This will be the point where I move from β€œjust running commands” to building automation workflows β€” a must-have step for any DevOps engineer.

🀝 Over to You

What was your first cronjob or SSH key setup experience like? Did it work on the first try, or did you spend hours debugging like me? Share your story πŸ‘‡

Top comments (0)