Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

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:
 
Most of the solution I found only works on Linux boxes.
Can you give an example of such a solution or a link? If you want to use cron it's there for you to use.
 

Attachments

  • Picture 13.png
    Picture 13.png
    99.6 KB · Views: 152
  • Picture 14.png
    Picture 14.png
    94.7 KB · Views: 117
Last edited:
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:
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:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.