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

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

--------------content of

curl >> /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 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.

1 Answer 1

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.