Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an online backup utility (zipcloud.com) And i scheduled an upload of projects folder every day at 12pm. Thing is my projects folder contains a lot of files so i thought the best I could do is to write a code to automatically zip the folder before it gets uploaded each day.

I have no knowledge of python or other mac languages in order to get this done. So help is really appreciated! :)

share|improve this question

migrated from stackoverflow.com Aug 12 '12 at 23:49

This question came from our site for professional and enthusiast programmers.

    
Incremental backup will be slower, not faster. Find out if you can compress the communications between the client and the server instead. –  tripleee Aug 12 '12 at 11:15
    
Why do you think I'm trying to zip my whole projects folder to one file before i upload? :p –  Ilya Karnaukhov Aug 12 '12 at 22:56
    
What I'm saying is: If your backup copies a new unique file of 20M every day instead of sending 1M of diffs to 20 small files, you are not making it faster. If you can compress those diffs on the wire, you could be better off (but if the client is competently written, it already compresses its communications channel). –  tripleee Aug 13 '12 at 4:37
add comment

3 Answers

You can write a script to compress your file - and then use the cron command to schedule it run it daily at the time you want.

share|improve this answer
add comment

The best thing you could do is create a little script that could compress your files. You can add the script as a crontab and set the time daily at 12pm. I am not sure if you would also like the script to SEND it to the server, but that would be easily possible.

You can check the python page here; http://docs.python.org/library/zipfile.html and crontab page here; http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man5/crontab.5.html

Good luck.

share|improve this answer
    
Looks promising. I was also thinking of something like this. But how do I write a cron for a mac? Could you also give me the code or at least an example of how to do this? I have no knowledge of Python.. :( –  Ilya Karnaukhov Aug 12 '12 at 13:41
add comment

Edit the crontab with crontab -e (or EDITOR=nano crontab -e) and add a line like this:

59 23 * * * cd ~/Notes; zip ~/Documents/Backups/Notes\ `date '+\%Y-\%m-\%d'`.zip *.txt

The format is minutes hours days months weekdays command. 0 */2 * * 1-5 would run a command every other hour on weekdays. % has to be escaped as \% in the command field.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.