Pages: [1]   Go Down
Send this topic | Print
Author Topic: Timestamp in cronjob backup?  (Read 584 times)
meep-online
Authority Member
****
Online Online

Posts: 983


WWW
« on: July 27, 2008, 10:57:16 PM »

Hello,
If you are running a cronjob in cpanel to backup your site, like so:
Code:
zip -r backup public_html
then how would you get it to back it up to like backup-(timestamp).zip, where (timestamp) is the current timestamp?
I'm no good with unix commands Duh

Cameron
Logged

Diemux
Underground3k.com!
Administrator
Official 110mb Guru
*****
Online Online

Posts: 12099


Use search before asking...


WWW
« Reply #1 on: July 27, 2008, 11:08:41 PM »

This is not for a 110MB website right?
Logged

Problems with your 110MB account of website: Visit the support database: http://help.110mb.com!
NOW available: PHPfusion-mods.net!
Underground3k
meep-online
Authority Member
****
Online Online

Posts: 983


WWW
« Reply #2 on: July 27, 2008, 11:14:03 PM »

No, its for a mates website Smiley
Logged

inp o҉rtb
The Gangsta
Global Moderator
Official 110mb Guru
*****
Offline Offline

Posts: 15633


experimental theologian


WWW
« Reply #3 on: July 28, 2008, 05:05:05 AM »

Hello,
If you are running a cronjob in cpanel to backup your site, like so:
Code:
zip -r backup public_html
then how would you get it to back it up to like backup-(timestamp).zip, where (timestamp) is the current timestamp?
I'm no good with unix commands Duh

If your shell is POSIX-compliant (like Bash), try:

zip -r backup-`date +%s`.zip public_html
Logged

Hi! I’m a signature virus! Add me to your signature to help me spread.
spam me: ispamspot@gmail.com

blog | my work @ deviantART | Imagine-ng image editor
meep-online
Authority Member
****
Online Online

Posts: 983


WWW
« Reply #4 on: July 28, 2008, 08:01:47 AM »

Ok thanks. I'll try that and see if it works Wink
Logged

meep-online
Authority Member
****
Online Online

Posts: 983


WWW
« Reply #5 on: July 29, 2008, 06:47:41 AM »

Hey I have tried doing
Code:
zip -r backups/backup`date +%y%m%d%H%M%S`.zip public_html
and it doesn't work. It gives the error:
Code:
/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/bin/sh: -c: line 1: syntax error: unexpected end of file
Logged

inp o҉rtb
The Gangsta
Global Moderator
Official 110mb Guru
*****
Offline Offline

Posts: 15633


experimental theologian


WWW
« Reply #6 on: July 29, 2008, 07:01:22 AM »

I guess not, then. What about writing a PHP job to rename the backup file?
Logged

Hi! I’m a signature virus! Add me to your signature to help me spread.
spam me: ispamspot@gmail.com

blog | my work @ deviantART | Imagine-ng image editor
Pages: [1]   Go Up
Send this topic | Print
Jump to: