Skip navigation
This discussion is archived

Backup calendars

2737 Views 9 Replies Latest reply: Feb 1, 2008 8:06 AM by MrHoffman RSS
hunteradh Level 1 Level 1 (0 points)
Currently Being Moderated
Jan 10, 2008 12:02 PM
Is there a way to backup my calendars on the server. It seems like there is no single .ics file in the calendars folder under the user that is the owner of the calendar. I think they broke it up into events instead. I would like to have the data automatically back up to a RAID a couple of times a day. I assume the events could be just imported the same as a single ics. If anyone has any suggestions or examples of how they are doing it.

Xserve, Mac OS X (10.5.1)
  • Rob B. Campbell Calculating status...
    Currently Being Moderated
    Jan 10, 2008 12:05 PM (in response to hunteradh)
    Why not just have the server do local Time Machine backups of itself?
    MacBook Pro, Mac OS X (10.5.1), Apple Consultant - ACTC
  • Cyrus Daboo Level 2 Level 2 (230 points)
    Currently Being Moderated
    Jan 10, 2008 12:49 PM (in response to Rob B. Campbell)
    Certainly TimeMachine will work. Though when restoring you will likely need to make sure the iCalServer is stopped.

    rsync is another option too.

    Note that both TimeMachine and rsync benefit by the one file per event model in that incremental backups are much more efficient that way.

    The key thing to remember when doing any backup or restores that the file system extended attributes MUST be included in that bacause iCalServer does use extended attributes on the files in its data store for storing WebDAV properties and other important metadata about events etc.
    MacPro, Mac OS X (10.5.1)
  • Eric Björkvall Calculating status...
    Currently Being Moderated
    Jan 22, 2008 11:12 PM (in response to hunteradh)
    I run ditto, as of 10.5 it preserves extended attributes by default:

    fil1=calendardump`date +'%Y-%m-%d_%H.%M'`.cpio.bz2
    ditto -cjv /Library/CalendarServer $fil1

    To unpack run: ditto -xj $fil1 dest_dir

    Just rigged this so I have not yet tried to restore....

    PowerMac7,3, Mac OS X (10.5.1)
  • Peter Thorn1 Calculating status...
    Currently Being Moderated
    Jan 27, 2008 12:38 PM (in response to Eric Björkvall)
    I have the same problem. I have tried to setup a script almost just like that:
    sudo ditto -cjv /Library/CalendarServer /icalbackup/calendar_dump`date +'%Y-%m-%d_%H.%M'`.cpio.bz2

    If I run it by terminal it works perfekt. I have then tried to set it up in Lingon ( in order for it to run automatically once a day but then it doesn't work - I get an error 1 in the log. Any ideas (the server has been rebooted).

    mac mini intel, Mac OS X (10.5.1), OS X server
  • Eric Björkvall Level 1 Level 1 (0 points)
    Currently Being Moderated
    Jan 27, 2008 1:18 PM (in response to Peter Thorn1)
    Save it to a small shell script, mine is called

    echo "Backing up calander server data from my calendar server with ditto"
    fil1=calendardump`date +'%Y-%m-%d_%H.%M'`.cpio.bz2
    cd /bupp
    ditto -cjv /Library/CalendarServer $fil1
    #unpack with ditto -xj $fil1 dest_dir
    #copy the cpio archive to another server, just in case...
    scp $fil1 buppuser@my-backup-server.local:/bupp/calendar/

    Save this script and add it to crontab:
    crontab -e

    14 01 * * * $HOME/ #run every night at 01:14

    Quad G5, Mac OS X (10.5.1)
  • Peter Thorn1 Level 1 Level 1 (20 points)
    Currently Being Moderated
    Jan 31, 2008 12:22 PM (in response to Eric Björkvall)
    Hi Eric
    Thanks for your reply!
    I have tried it but without any luck:
    - I created the .sh script, changed owner to root (via chown), chmod it 777
    - if I go to the script in terminal and sudo run it (sudo ./ it works fine
    - I have inserted it into cron (did it via pico - "pico crontab -e"), has saved it and closed it (and reopened it to check that it is there)
    - but it doesn't run by it self...
    I remember that apple is trying to get people to use launchd instead of cron - do I have to enable the use of cron on 10.5.1?

  • Eric Björkvall Level 1 Level 1 (0 points)
    Currently Being Moderated
    Feb 1, 2008 1:38 AM (in response to Peter Thorn1)
    Hmm, you have to run the command crontab - not edit a file called crontab... (well you can actually edit the crontab files directly, they're hidden somewhere under /var but it is not recommended).
    the command 'crontab -e' edits the crontab file with via, if you prefer pico try this:

    In a terminal window paste the following:

    EDITOR=/usr/bin/pico;export EDITOR

    #the run

    crontab -e

    PowerMac G5 Quad, Mac OS X (10.5.1)
  • MrHoffman Level 6 Level 6 (11,710 points)
    Currently Being Moderated
    Feb 1, 2008 8:06 AM (in response to Eric Björkvall)
    And available tools such as shush and [cronic|> can sometimes be useful, as [Vixie's cron| on.8.html] doesn't necessarily do what you want with output; cron tends to be entirely too willing to mail the output of the commands and bash scripts around.

    I haven't used nor needed these cron assists on Mac OS X (well, not yet), as my scripts haven't triggered the cron mail processing.

    [launchctl and launchd| /launchctl.1.html] are an upgrade path for many tasks performed by cron.
    Mac OS X (10.4.10)


More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.