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.
Thank you for your feedback.
Sorry about that :( We'll work to make it better.
You voted before.
5 times viewed | 0 people fount it helpful