[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-date: Wed Mar 23 13:57:39 2005 -->
- <!--x-from-r13: nyr1 ng ploregrpupnsr.arg (@nguna X. Gaqrejbbq) -->
- <!--x-message-id: [email protected] -->
- <!--x-subject: [ale] OT: sync iPod with Sunbird Calendar (sortof) -->
- <li><em>date</em>: Wed Mar 23 13:57:39 2005</li>
- <li><em>from</em>: ale1 at cybertechcafe.net (Nathan J. Underwood)</li>
- <li><em>subject</em>: [ale] OT: sync iPod with Sunbird Calendar (sortof)</li>
First, a couple of notes. This is a work in progress, and isn't meant
to be a be-all / end-all (basically, no flames please). Second, it's
OT, probably could get the 'very OT' stamp without too much of a
stretch. Third, it's (in it's current state) for a Windoze environment
running cygwin, but it should be pretty easy to tweak it a bit so that
it's usable on anything that'll run bash.
Now, to the good stuff. I recently (Sunday) broke down and bought an
iPod. After opening the box and tinkering with it a bit, I found that
it supports iCal, so I was off to try to find a way to get it to sync
with my Mozilla Calendar (plugin for the Firefox browser). Suffice it
to say, I didn't find much, so I started looking for a way to do it on
my own, and came up with this little solution.
switch.bat -> simply a batch file telling it to run this in bash
update.sh -> a bash script that checks for the existence of a
calendar.ics file, and backs it up (*moves it to calendar.ics.old), and
then downloads (using wget & ftp) the calendar file from an ftp server.
I realize that this is probably pretty elementary for most of the
coding guru's out there, but it's pretty functional for me, and I
thought maybe someone else could use it.
* move rather than copy because I'm using wget to download the actual
calendar file, and wget doesn't want to overwrite the original
--
--
registered linux user # 73046
-------------- next part --------------
bash ./ipod_update.sh
-------------- next part --------------
#!/cygdrive/c/cygwin/bin/bash
#===========================
# Setup some Variables
#===========================
CFILENAME='calendar.ics'; # Calendar file name (from current path)
FTPSVR='my.ftpserver.tld'; # FTP Server (fqdn to SERVER, not path)
FTPPATH='calendar'; # Path (from ftproot) to calendar file directory
FTPUNAME='username'; # Username for FTP server
FTPPASS='password'; # Password for FTP user
#===========================
# Get the necessary commands
#===========================
CP=$(which cp); # copy
MV=$(which mv); #
GET=$(which wget); # wget (this is how we will get the calendar file)
# Check for current calendar file
if [ -f $CFILENAME ]
then
if [ -f $CFILENAME.old ]
then
rm -rf $CFILENAME.old
fi
$MV $CFILENAME $CFILENAME.old
else
echo "No previous calendar file found"
fi
# Now, download the file
$GET <a rel="nofollow" href="ftp://$FTPUNAME:$FTPPASS@$FTPSVR/$FTPPATH/$CFILENAME">ftp://$FTPUNAME:$FTPPASS@$FTPSVR/$FTPPATH/$CFILENAME</a>
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00404" href="msg00404.html">[ale] OT: sync iPod with Sunbird Calendar (sortof)</a></strong>
<ul><li><em>From:</em> ale1 at cybertechcafe.net (Nathan J. Underwood)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00402.html">[ale] MYSQL with transactional support</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00404.html">[ale] OT: sync iPod with Sunbird Calendar (sortof)</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00392.html">[ale] MYSQL with transactional support</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00404.html">[ale] OT: sync iPod with Sunbird Calendar (sortof)</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00403"><strong>Date</strong></a></li>
<li><a href="threads.html#00403"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>