June 2nd, 2009, 09:46 AM
ubuntu server backup
is there a way or perhaps a script that the files from the server can be archive or be zipped?
June 2nd, 2009, 07:14 PM
You could use tar to make an archive. Although, I am really not sure exactly what you are trying to do...
\"Those of us that had been up all night were in no mood for coffee and donuts, we wanted strong drink.\"
June 3rd, 2009, 01:53 AM
Ubuntu is a little different from most distros, but I'm pretty sure it still has the base Linux installation stuff, which means if you need to do this you shouldn't need any extra software. Tar was mentioned already and is an easy to basically make a huge file of a bunch of other files, and then you can gzip it into a little tar.gz file, which is a gzipped tarball.
Also, you can use bunzip2 which has better compression normally, but also takes longer to make the file.
And 7Zip generally comes with most Linux distros. try this:
apt-get install 7zip
If it doesn't work, or says it's already installed you're done there and can use that, or, just use that normal tar and gzip.
June 3rd, 2009, 08:51 AM
my boss actually needs this or (or maybe he knows already and wants to test me) and he wants me to find script or a command on the cronjobs that can zip, gzip, tar.
June 3rd, 2009, 04:25 PM
Managers are idiots. He's probably thinking Winzip. Which works on Windows.
In all seriousness, if you need to find this in a CronJob....Well, go to /etc:
Then read what Cron Jobs have been set already and see if there is one someone added in there that actually does this, or you could, well, I guess you could add one where you zipped up certain files and directories, most distros come already with zip and Gzip now, bit the standard one that's normally there is gzip.
For multiple files, remember to tar them first
you can check out more with this:
June 3rd, 2009, 05:46 PM
For large compressed files, I prefer bzip2. Better compression, but you pay for it somewhat in longer comp/decomp wall times. google "bzip2 vs gzip" if you want to understand in more detail.
In God We Trust....Everything else we backup.
June 3rd, 2009, 05:54 PM
That's what I meant to say by bunzip2 in my first reply. Wasn't thinking straight and only gave the unzip version by mistake.
Originally Posted by Cheap Scotch Ron
June 11th, 2009, 04:36 PM
You could easily use "tar -cf <name-of-tar> <things-to-backup> to gather all thath needs to be backed up.
From the other hand you could rsync to a disk or another server. For example, I have a script to backup to my USB-drive. The script is not entirely finished but it works.
It only adds/deletes/updates files depending on what has happened with a file.
For the reference, if you can do anything with it (I'm not a good scripter ):
DETECTION=`cat /proc/bus/usb/devices | grep SerialNumber=$DRIVE_SERIAL`
if [ "$DETECTION" == "" ]; then
echo "`date "+%b %d %H:%m:%S"` - USB-drive not attached. Exit." >> $LOGFILE
echo "`date "+%b %d %H:%m:%S"` - USB-drive found !" >> $LOGFILE
echo "`date "+%b %d %H:%m:%S"` - Checking for running jobs ..." >> $LOGFILE
if [ -f "$BUSYFILE" ]; then
echo "`date "+%b %d %H:%m:%S"` - Busy-file found !" >> $LOGFILE
echo "`date "+%b %d %H:%m:%S"` - Another backup already in progress. Exit." >> $LOGFILE
echo "`date "+%b %d %H:%m:%S"` - Busy-file not found. Good. Proceeding to backup." >> $LOGFILE
echo "1" >> $BUSYFILE
echo "`date "+%b %d %H:%m:%S"` - Mounting USB-drive ..." >> $LOGFILE
mount -t ntfs-3g /dev/sdc1 /mnt/backup
echo "`date "+%b %d %H:%m:%S"` - RSYNC Started." >> $LOGFILE
rsync -vrlptg --log-file=$RSYNC_LOGFILE /xen/ /mnt/backup/Backup/xen
rsync -vrlptg --log-file=$RSYNC_LOGFILE /raid3/ /mnt/backup/Backup/data
echo "`date "+%b %d %H:%m:%S"` - RSYNC Finished." >> $LOGFILE
echo "`date "+%b %d %H:%m:%S"` - Unmounting drives ..." >> $LOGFILE
echo "`date "+%b %d %H:%m:%S"` - Releasing BACKUP_BUSY variable ..." >> $LOGFILE
Last edited by Raiden; June 11th, 2009 at 04:39 PM.
June 18th, 2009, 01:22 PM
thanks for the tip. always been helpful. i'll make use of this script and perhaps expand to what i know. thank you.
By cheyenne1212 in forum Miscellaneous Security Discussions
Last Post: February 1st, 2012, 02:51 PM
By nebulus200 in forum Other Tutorials Forum
Last Post: August 3rd, 2004, 06:32 PM
By Tiger Shark in forum The Security Tutorials Forum
Last Post: March 4th, 2004, 05:00 PM
By CXGJarrod in forum Microsoft Security Discussions
Last Post: July 23rd, 2003, 11:00 PM
By -DaRK-RaiDeR- in forum Newbie Security Questions
Last Post: December 14th, 2002, 08:38 PM
Tags for this Thread