0

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.

Magellan
  • 4,451
  • 3
  • 30
  • 53

1 Answers1

1

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

jscott
  • 24,484
  • 8
  • 79
  • 100
Alex
  • 6,603
  • 1
  • 24
  • 32