Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a bash script to run as a cronjob with Cpanel:

--------------content of cron.sh---------------------

#!/bin/bash
curl http://website.com/1.gif >> /home/myuser/public_html/directory/1.gif

------------ end of content -------------------------

I would expect curl to overwrite any existing files, but what occurs is that every time the cron job is executed the destination file doubles in size!

ex: after 1 cron: 1.gif size 50kb

after 2 cron: 1.gif size 100kb

and so on...

I would like simply to overwrite the target file.

share|improve this question

closed as off-topic by Katherine Villyard, masegaloeh, Ward, EEAA, Jenny D Apr 21 '15 at 8:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

Just change the >> to >. The >> is making it append to the file.

share|improve this answer
    
Thank you! Solved – Antonio Colella Apr 27 '12 at 20:48

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