Changes

Jump to navigation Jump to search
1,955 bytes added ,  06:45, 17 May 2009
Data size calculation for backups
Line 172: Line 172:     
Changes to this file will be overwriten during upgrades.
 
Changes to this file will be overwriten during upgrades.
 +
 +
 +
===Data size calculation for backups===
 +
 +
Depending on where data is stored on your server, the backup size reported by the server-manager may be less accurate eg if a lot of data is stored in /opt
 +
 +
A simple command can be saved as a script file and run when required to calculate the data size on the server for the folders backed up by default. Additional folders eg /opt can be included to suit particular requirements.
 +
The calculated size can be considered the largest possible backup size, as it is the size before any compression is applied. The degree of compression depends on content/file type, so the actual resultant backup file size will vary from server to server.
 +
The default backup folder list is obtained from /usr/lib/perl5/site_perl/esmith/Backup.pm
 +
 +
mkdir -p /opt/scripts
 +
cd /opt/scripts
 +
pico -w datasize
 +
 +
Then enter the following command (with /opt included)
 +
du -hsc /home/e-smith /etc/e-smith/templates-custom \
 +
/etc/e-smith/templates-user-custom /etc/ssh /root \
 +
/etc/sudoers /etc/passwd /etc/shadow /etc/gshadow \
 +
/etc/samba/secrets.tdb /etc/samba/smbpasswd /etc/smbpasswd /opt
 +
 +
or enter it as one long line without the \
 +
du -hsc /home/e-smith /etc/e-smith/templates-custom /etc/e-smith/templates-user-custom /etc/ssh /root /etc/sudoers /etc/passwd /etc/shadow /etc/gshadow /etc/samba/secrets.tdb /etc/samba/smbpasswd /etc/smbpasswd /opt
 +
 +
Save the file and exit by pressing the following keys at the same time
 +
Ctrl o
 +
Ctrl x
 +
 +
Make the file executable
 +
chmod +x /opt/scripts/datasize
 +
 +
Run the command, which may take a few minutes to complete
 +
/opt/scripts/datasize
 +
 +
You should see output similar to
 +
151G    /home/e-smith/
 +
76K    /etc/e-smith/templates-custom/
 +
4.0K    /etc/e-smith/templates-user-custom/
 +
152K    /etc/ssh/
 +
289M    /root/
 +
4.0K    /etc/sudoers
 +
8.0K    /etc/passwd
 +
4.0K    /etc/shadow
 +
4.0K    /etc/gshadow
 +
12K    /etc/samba/secrets.tdb
 +
4.0K    /etc/samba/smbpasswd
 +
98M    /opt
 +
151G    total
    
===Command line manual Restore from USB drive or memory stick===
 
===Command line manual Restore from USB drive or memory stick===
624

edits

Navigation menu