Ege Bostancı

rclone ile Saatlik Google Drive Yedekleme (CachyOS)

8 Nisan 2026 3 dk okuma

CachyOS üzerinde ~/Desktop ve ~/Downloads klasörlerini tek yönlü olarak Google Drive’a yedekleyen kurulum. Saatte bir otomatik çalışır, sistemi yavaşlatmaz.

Genel Mimari

Kurulum Adımları

1. rclone kurulum ve yapılandırma

sudo pacman -S rclone
rclone config

rclone config içinde:

2. Hedef klasörleri oluştur

rclone mkdir gdrive:Backup/Desktop
rclone mkdir gdrive:Backup/Downloads

3. İlk manuel sync

rclone sync ~/Desktop gdrive:Backup/Desktop -P --exclude '.venv/**' --exclude 'venv/**' --exclude '__pycache__/**' --exclude 'node_modules/**' --exclude '.git/**' --exclude '*.pyc' --exclude '.cache/**' --exclude '.DS_Store'

rclone sync ~/Downloads gdrive:Backup/Downloads -P --exclude '*.part' --exclude '*.crdownload' --exclude '.DS_Store'

Not: Fish’te backslash ile satır kırma sorun çıkarıyor, tek satır olarak yaz.

4. Yedekleme script’i

~/.local/bin/rclone-backup.sh:

#!/bin/sh
set -e
LOG="$HOME/.local/state/rclone-backup.log"
mkdir -p "$(dirname "$LOG")"
echo "=== $(date -Iseconds) backup started ===" >> "$LOG"

rclone sync "$HOME/Desktop" gdrive:Backup/Desktop \
  --exclude '.venv/**' --exclude 'venv/**' --exclude '__pycache__/**' \
  --exclude 'node_modules/**' --exclude '.git/**' --exclude '*.pyc' \
  --exclude '.cache/**' --exclude '.DS_Store' \
  --log-file="$LOG" --log-level INFO

rclone sync "$HOME/Downloads" gdrive:Backup/Downloads \
  --exclude '*.part' --exclude '*.crdownload' --exclude '.DS_Store' \
  --log-file="$LOG" --log-level INFO

echo "=== $(date -Iseconds) backup finished ===" >> "$LOG"
chmod +x ~/.local/bin/rclone-backup.sh

5. systemd service

~/.config/systemd/user/rclone-backup.service:

[Unit]
Description=rclone Desktop+Downloads -> Google Drive backup
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
ExecStart=%h/.local/bin/rclone-backup.sh
Nice=19
IOSchedulingClass=idle

6. systemd timer

~/.config/systemd/user/rclone-backup.timer:

[Unit]
Description=Hourly rclone backup (Desktop+Downloads -> gdrive)

[Timer]
OnBootSec=10min
OnUnitActiveSec=1h
Persistent=true

[Install]
WantedBy=timers.target

7. Etkinleştir

systemctl --user daemon-reload
systemctl --user enable --now rclone-backup.timer

Günlük Komutlar

NeKomut
Timer durumunu görsystemctl --user list-timers rclone-backup.timer
Servis durumunu görsystemctl --user status rclone-backup.service
Manuel tetiklesystemctl --user start rclone-backup.service
Durdur (geçici)systemctl --user stop rclone-backup.service
Timer’ı kapatsystemctl --user disable --now rclone-backup.timer
Logtail -f ~/.local/state/rclone-backup.log
Çalışan rclone’ları görpgrep -a rclone
Drive disk durumurclone about gdrive:

Sıklığı Değiştirmek

~/.config/systemd/user/rclone-backup.timer içinde OnUnitActiveSec=1h değerini 3h, 6h, 12h gibi değiştir, sonra:

systemctl --user daemon-reload
systemctl --user restart rclone-backup.timer

Dikkat Edilenler / Öğrenilenler

İlk Sync Boyutları