Discussion:
Copy Backups on a schedule to a network drive
C LK
2012-04-05 07:46:52 UTC
Permalink
C LK [http://community.zenoss.org/people/imechanics] created the discussion

"Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65720#65720

--------------------------------------------------------------
Hello

I have successfully created zenoss backups using crontab. For disaster recovery purposes I would like to copythese backups to a network drive. Would anyone be able to provide guidance on how I should go about this?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65720#65720]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jmp242
2012-04-05 11:43:48 UTC
Permalink
jmp242 [http://community.zenoss.org/people/jmp242] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65738#65738

--------------------------------------------------------------
Cron that rsyncs to the network path?

--
James Pulver
ZCA Member
LEPP Computer Group
Cornell University
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65738#65738]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
C LK
2012-04-06 14:53:24 UTC
Permalink
C LK [http://community.zenoss.org/people/imechanics] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65750#65750

--------------------------------------------------------------
I tried manually with this command syntax and it works
cp -rp /usr/local/zenoss/zenoss/backups "/volumes/data/zenoss backups"
In crontab, the command does not execute.
0 23/4 * * * cp -rp /usr/local/zenoss/backups/*.* "/volumes/data 1/zenoss backups"

Where am I going wrong?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65750#65750]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
nilie
2012-04-08 04:09:12 UTC
Permalink
nilie [http://community.zenoss.org/people/nilie] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65759#65759

--------------------------------------------------------------
1. What crontab, system, root, your user or zenoss user ?
2. Does not execute is not giving us enough information to help us help you. Any error message in cron log or other system log ? Usually when you are testing a cron job, you should should redirect the output and any errors into a special log file that will give you an indication on what really happens with that particular job at run time. Try appending

+*> /tmp/joberror.log  2>&1*+ (make sure the user account running the cron job has the permission to write into that directory) at the end of your crontab entry.

Can you please do this and post the result here ?

Hope this will help,
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65759#65759]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
C LK
2012-04-08 22:51:23 UTC
Permalink
C LK [http://community.zenoss.org/people/imechanics] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65761#65761

--------------------------------------------------------------
I am using OS X and created the job under the user zenoss.
sudo crontab -u zenoss -e

The error message I receive is access denied to the network volume. Do I need to put the authentication details in the job? How do I resolve this?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65761#65761]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
themactech
2012-04-08 22:59:38 UTC
Permalink
themactech [http://community.zenoss.org/people/themactech] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65753#65753

--------------------------------------------------------------
Does the zenoss user have write privileges on your destination volume, and is it mounted?

Manuel
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65753#65753]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
C LK
2012-04-08 23:09:57 UTC
Permalink
C LK [http://community.zenoss.org/people/imechanics] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65754#65754

--------------------------------------------------------------
The volume is mounted. How do I check if it has write priveledges?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65754#65754]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
themactech
2012-04-09 16:55:09 UTC
Permalink
themactech [http://community.zenoss.org/people/themactech] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65766#65766

--------------------------------------------------------------
Make sure your network share is set to read/write privileges for the zenoss user, you can also check when the process is running using that it is indeed running as the zenoss user.  Maybe the process gets launched as root and therefore requires root read/write.

Manuel
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65766#65766]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
C LK
2012-04-13 19:10:36 UTC
Permalink
C LK [http://community.zenoss.org/people/imechanics] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65899#65899

--------------------------------------------------------------
I can copy using

cp -rp /usr/local/zenoss/zenoss/backups/*.* "/Volumes/Data 1/zenoss backups"

at the command line.

I just cannot run it as a cron job.

I added the zenoss user to the network share.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65899#65899]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
themactech
2012-04-13 19:16:11 UTC
Permalink
themactech [http://community.zenoss.org/people/themactech] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65900#65900

--------------------------------------------------------------
Maybe this would be a case of the cron not being able to use quoted paths, for amusement's same, try replacing:

"/Volumes/Data 1/zenoss backups"

with a unix proper escape character path, i.e.

/Volumes/Data\ 1/zenoss\ backups

Just in case that would run, would be a easy test, my guess is this is not your issue since you seem to be connecting to the share, hence the permission error.

Another option would be to use a shell script to trigger an AppleScript doing a similar command, AppleScripting the finder is sometimes more forgiving than the shell in OS X.  For instance you can use AppleScript to rename a file with unix banned characters, whereas you can't do that from any shell commands or scripts.

Manuel
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65900#65900]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
themactech
2012-04-13 19:17:14 UTC
Permalink
themactech [http://community.zenoss.org/people/themactech] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65901#65901

--------------------------------------------------------------
BTW I will try and spend some time helping you with this in the next few days, I could not do so last 2 weeks, apologies.

Manuel
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65901#65901]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
C LK
2012-04-13 19:37:30 UTC
Permalink
C LK [http://community.zenoss.org/people/imechanics] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65863#65863

--------------------------------------------------------------
Thanks Manuel. But that  your suggestions did not work.nis it possible to authenticate when the cp command is run ?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65863#65863]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
themactech
2012-04-15 04:38:31 UTC
Permalink
themactech [http://community.zenoss.org/people/themactech] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65904#65904

--------------------------------------------------------------
How about trying the SCP command?

scp /path/to/local/file ***@hostname:/path/to/remote/file

you can create public keys so this can run from your target to your destination without authentication, see this page for instructions:

http://outhereinthefield.wordpress.com/2007/10/31/passwordless-scp-authentication-for-unattendedbatch-process/ http://outhereinthefield.wordpress.com/2007/10/31/passwordless-scp-authentication-for-unattendedbatch-process/

As long as SSH is enabled on your destination you should be good.  Let me know if this fixes this.

Manuel
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65904#65904]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
nilie
2012-04-16 19:05:34 UTC
Permalink
nilie [http://community.zenoss.org/people/nilie] created the discussion

"Re: Copy Backups on a schedule to a network drive"

To view the discussion, visit: http://community.zenoss.org/message/65913#65913

--------------------------------------------------------------
This might be a silly question but when you do the copy with

cp -rp /usr/local/zenoss/zenoss/backups/*.* "/Volumes/Data 1/zenoss backups"

at the command line are you logged in as zenoss user ?

Also, speaking about NAS, how is the volume shared ? What protocol are you using SMB, NFS or other ? Usually sharing a network drive involve some user and/or permission mapping.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65913#65913]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...