Knowledge Base

How can I back up my server?

How can I back up my server?

Local backup: ```bash tar czf /root/backup-$(date +%F).tar.gz /var/www /etc /home ``` This creates a compressed .tar.gz archive of /var/www, /etc, and /home. Remote backup: Use rsync to sync data to another server: ```bash rsync -avz /var/www backup@:/backup/path ``` Automatic backup: Create a backup script (e.g., /usr/local/bin/backup.sh) with the above commands and set up a cronjob: ```ruby 0 2 * * * /usr/local/bin/backup.sh ``` This will run the backup every day at 02:00.

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?

5 times viewed | 0 people fount it helpful

Top