rclone ile Saatlik Google Drive Yedekleme (CachyOS)
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
- Tek yön: Local → Drive. Local’de silinen Drive’dan da silinir. Drive’daki değişiklikler local’i etkilemez.
- Hedef:
gdrive:Backup/Desktopvegdrive:Backup/Downloads - Tetikleme: systemd user timer, her 1 saatte bir
- Öncelik: Nice 19 + IO idle (sistemi yavaşlatmaz)
Kurulum Adımları
1. rclone kurulum ve yapılandırma
sudo pacman -S rclone
rclone configrclone config içinde:
n(new remote), name:gdrive- Storage:
drive(Google Drive) - client_id / secret: boş
- scope:
1(full access) - Auto config:
y→ tarayıcıda Google ile giriş - Shared Drive:
n
2. Hedef klasörleri oluştur
rclone mkdir gdrive:Backup/Desktop
rclone mkdir gdrive:Backup/Downloads3. İ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.sh5. 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=idle6. 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.target7. Etkinleştir
systemctl --user daemon-reload
systemctl --user enable --now rclone-backup.timerGünlük Komutlar
| Ne | Komut |
|---|---|
| Timer durumunu gör | systemctl --user list-timers rclone-backup.timer |
| Servis durumunu gör | systemctl --user status rclone-backup.service |
| Manuel tetikle | systemctl --user start rclone-backup.service |
| Durdur (geçici) | systemctl --user stop rclone-backup.service |
| Timer’ı kapat | systemctl --user disable --now rclone-backup.timer |
| Log | tail -f ~/.local/state/rclone-backup.log |
| Çalışan rclone’ları gör | pgrep -a rclone |
| Drive disk durumu | rclone 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.timerDikkat Edilenler / Öğrenilenler
- Symlink’ler:
.venviçindeki Python symlink’leri rclone’u uyarıyor — zaten exclude’luyoruz. - Yarım indirmeler:
*.partve*.crdownloadexclude’landı. - Çakışma: Manuel
rclone syncçalışırken timer da tetiklerse iki process aynı anda Drive’a yazmaya çalışır. Manuel sync bitene kadar servisi durdur:systemctl --user stop rclone-backup.service(timer açık kalabilir). - Vault yedekleme: Bu kurulum sadece Desktop + Downloads içindir. Obsidian vault’unu bu yöntemle yedekleme — conflict riski yüksek, ayrıca çözülmeli (Syncthing / Obsidian Sync).
- Insync alternatifi: Ücretli (~30$) gerçek iki yönlü sync istersen
yay -S insync. Bu kurulumu kullanıyorsan gerek yok.
İlk Sync Boyutları
- Desktop: ~19.5 GiB (exclude’lar sonrası daha az)
- Downloads: ~21.9 GiB, 7m52s sürdü (~50 MiB/s)