• Domains
  • Web Hosting
  • WordPress Hosting
  • Reseller Hosting
  • Cloud VPS
  • Dedicated Servers
  • Domains
  • Web Hosting
  • WordPress Hosting
  • Reseller Hosting
  • Cloud VPS
  • Dedicated Servers
home/Knowledge Base/Dedicated Servers/Backup Storage/Automating FTP Backups in Linux
Popular Search:Dedicated Server, CentOS, Web Hosting

Automating FTP Backups in Linux

45 views 0 November 26, 2019 aklwebhost

This is a simple backup script for Linux dedicated servers to back up a specific directory and all of it’s sub directories and save them in your backup FTP storage, organized by date.

1. Download lftp using the command: yum install lftp (CentOS) or apt-get install lftp (Debian and Ubuntu)

2. Have a directory in the root of the back up FTP named “backup”

3. Modify the script bellow with your credentials and settings:

#!/bin/bash

### FTP login credentials bellow ###
FTPU=”FTP-Username”
FTPP=”FTP-Password”
FTPS=”FTP-IP-Address”

NOW=$(date +”%d-%m-%Y”)
### local directory to backup ###

FILE="/DIR-to-Backup"

### Login to remote server ###
### No need to edit any of the fields bellow ###
### Default DIR is backup ###

lftp -u $FTPU,$FTPP -e “cd backup;mkdir $NOW;cd $NOW;mirror -R $FILE /backup/$NOW;quit” $FTPS
4. Save the script as backup.sh and run “chmod +x ./backup.sh” to make into an executable.

5. run the back up script by typing ./backup.sh

The script can be scheduled as a cron job for automated backups on a specific frequency.

Tags:Automating FTP Backups in Linux

Was this helpful?

Yes  No
Related Articles
  • Managing Backup Storage
  • Automating FTP Backups in Windows Server
Leave A Comment Cancel reply

Backup Storage
  • Automating FTP Backups in Linux
  • Managing Backup Storage
  • Automating FTP Backups in Windows Server
Popular Articles
  • Using StrongSwan for IPSec VPN on CentOS 7
  • Disabling SSDP (Linux / Windows)
  • Can I pay by Western Union?
  • Can a Coupon Code Discount Be Carried Forward While I Upgrade My VPS Account
  • Can I pay multiple due invoices using a single transaction?
KB Categories
  • Billing
  • Cloud Hosting
  • CMS Hosting
  • cPanel/WHM Control Panel Guide
  • Dedicated Servers
    • AMD Opteron 6272
    • Arch
    • Backup Storage
    • Bandwidth
    • Basic Security
    • BSD
    • CentOS
    • Containers
    • CoreOS
    • DDoS Protection
    • Debian
    • Dedicated Server Control Panel
    • Intel Core i5 3550
    • Intel Core i5 4570
    • Intel Core i7 3770
    • Intel Core i7 4770
    • Intel Xeon E3 1230 V3
    • Intel Xeon E3 1245 V2
    • IP Space
    • Linux Guides
    • Minecraft
    • Networking
    • Server Apps
    • Server Troubleshooting
    • Ubuntu
    • Windows Guides
    • Windows Server 2008
    • Windows Server 2012
  • Domain Names
  • Email Support Documentation
    • Setup IMAP or POP
    • User Features – How To
    • Webmail – How To
  • FTP (File Transfer Protocol
    • CuteFTP Guide
    • FileZilla Guide
  • Game Servers
  • MySQL and MariaDB
  • Node.js
  • Plesk Web Hosting Guide
  • VPS Server
  • Web Servers

Automating FTP Backups in Windows Server  

  • Privacy Policy
  • Terms of Use
  • © 2022 AKLWEB HOST LLC, All Rights Reserved.

Popular Search:Dedicated Server, CentOS, Web Hosting