So, I have a bash script that should pipe the output of ifconfig to a text file on the hour, every hour. As many people seem to have encountered, this script does not function properly when used by cron. However, most of the fixes for this that I have seen do not seem to be applicable in my case. I have all paths explicitly stated, the script has execute permissions, and there is a newline at the end of the cron file.
creatively enough, my scrip, ip.sh, contains:
ifconfig > /home/drake/Dropbox/maintenance_scripts/ip.txt
the cron entry is:
0 * * * * /home/drake/Dropbox/maintenance_scripts/ip.sh
(i have it running every minute for debugging)
The BIG issue here is, when it runs, and it does run, is that it clears ip.txt of any contents it might have. Also, I have another script which does the same exact thing with uptime, and it works w/o any issues, which just has be confused. I have also tried >>, which seemed to yield identical results
So, Does anyone have any ideas why one script might function as expected, and another would just derp-out like this?
This is running on my Ubuntu server. I am using Dropbox to sync the text-files