Mac How to ftp, scp or mail from Cron to web

donnist

macrumors newbie
Original poster
May 13, 2009
5
0
I am trying to send logs stored on my mac at home to my webpage so they can be viewed online. I want it to be done via cron jobs. Most of the solution I found only works on Linux boxes. Thanks in advance! :apple:
 

donnist

macrumors newbie
Original poster
May 13, 2009
5
0
I found a cron job that runs a shell script...

Thanks Kryten2

I found a cron job that runs a shell script... this is sort of what I am looking for but how would it be done via scp or email. I just want to find the most simplest way possible.


Here is the example:
################################################
#
Code:
crontab -e
1 17 * * * "/usr/bin/lftp -c "open $hostname && user $username $password && cd $current_dir && get -c $file_name"


#!/bin/ksh

sdir="/var/mqm/tmp/pso/"
filename="pso_whse_orders_inout"
hostname="n0aif01"
username="evaxd4"
password="march2012"

ftp -in $hostname <<EOF
user $username $password

binary
cd $sdir
get $filename /location/to/localfile
quit
EOF

mv -f $filename $filename.`date '+%Y%m%d'`
################################################
 
Last edited by a moderator:

kryten2

macrumors 6502a
Mar 17, 2012
999
60
Belgium
If you want it to be done via cron jobs you'll have to write a script. If you're not comfortable with writing scripts or adapting the ones you find on the net to your needs, you might want to take a look at Automator.

Automator email ex :

  1. Get Specified Finder Items
  2. New Mail Message
  3. Save as iCal Alarm plugin (This has changed on SL, Lion and ML)

Automator scp ex :

Uploading files using SCP with an Automator Service info : http://www.rmacd.com/code/2011/1127/1715.html
Using the Upload with SCP action from Automatorworld : http://automatorworld.com/archives/upload-with-scp/

Note: both use public/private-key authentication!
 
Last edited:

Similar threads

  • Aouttier
7
Replies
7
Views
633
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.