General Mac OS X Discussion General Apple and Mac OS X Discussion

Reply
 
LinkBack Thread Tools Display Modes
  (#11) Old
Member
 
stone's Avatar
 
Posts: 31
Join Date: Aug 2009
Location: austin, tx
Default 08-08-2009, 08:36 AM

ok, figured out my exec permissions... i had to:

chmod 755 ~/Dropbox/tracking/tracking.sh
chmod 755 ~/Dropbox/tracking/isightcapture

i also modified the shell script so that instead of overwriting it would create new files and date-time stamp them. i figure its only like 30k every time it captures and dropbox gives me 2gig, i can run it for a long time and not have to worry.
Attached Files
File Type: zip tracking_datetimestamp.zip (544 Bytes, 12 views)


dell mini 10v, running OSX 10.6.3, 160g hdd, 1.3 cam, 6 cell bat, 1gig ram, 1024x576 screen, usb logitech mouse, caselogic slipcase
Reply With Quote
  (#12) Old
Member
 
stone's Avatar
 
Posts: 31
Join Date: Aug 2009
Location: austin, tx
Default 08-08-2009, 05:55 PM

well for some reason the cron job does not fire the photo capture or the screen cap [see below]. it does the other text files, but not the photo. if i run the .sh from the command line, it works and does take a photo. so there's something the crontab needs to execute those lines.

what am i missing?
[i'm new to linux/osx command line]


also:
add this line to the .sh for a screencap
warning: file size is about 250k

screencapture -x ~/Dropbox/tracking/output/t${TDATE}_screencap.png


dell mini 10v, running OSX 10.6.3, 160g hdd, 1.3 cam, 6 cell bat, 1gig ram, 1024x576 screen, usb logitech mouse, caselogic slipcase
Reply With Quote
  (#13) Old
Junior Member
 
Posts: 11
Join Date: Jul 2009
Default 08-14-2009, 03:49 AM

Quote:
Originally Posted by vdub6127 View Post
* How do I make a cron job?

- Open a terminal
- Type: crontab -e
- This opens vi to edit the cron file. Press "i" to enter interactive mode
- Type or paste: 00,15,30,45 * * * * ~/Dropbox/tracking/tracking.sh >/dev/null 2>&1
(translation: run tracking.sh every 15 minutes, technically at :00 :15 :30: 45 on the hour, ignore error output)
- type :wq! to save and exit
- Type crontab -l at the terminal to verify your job was added
i went into terminal and type "crontab -e" then pressed enter and that pulled up a window then i typed "i" which just made the bottom of the window say "-INSERT-" nothing about any interactive mode. then i pasted the above and pressed enter but typing ":wq!" didnt save and exit, it just entered the text in the line below. it says "no crontab..." when i do "crontab -l" and press enter in terminal so i am clearly doing something wrong... do you have any advice as to how to get this working? i am not that familiar with command lines, sorry.
other question: whenever i turn on my mini 9 it ask for my computer password to use dropbox - if someone stole it they obviously wouldn't know my password and the file would not get updated to the dropbox, right? this might have to do with my dropbox being located on my sdhc card instead of ssd but i was just wondering if you guys got this as well. thanks


vostro a90: 16gb stec ssd, 2gb ram, bluetooth, .3mp webcam, 16gb SDHC C4, OSX 10.6.2 NBI 0.8.3F

Mini 10v: stock, OSX 10.6.2, NBI 0.8.3F
Reply With Quote
  (#14) Old
Senior Member
 
jetkins's Avatar
 
Posts: 183
Join Date: Jul 2009
Location: Austin, TX
Default 08-14-2009, 04:54 PM

Quote:
Originally Posted by iphown View Post
i went into terminal and type "crontab -e" then pressed enter and that pulled up a window then i typed "i" which just made the bottom of the window say "-INSERT-" nothing about any interactive mode. then i pasted the above and pressed enter but typing ":wq!" didnt save and exit, it just entered the text in the line below.
There's a step missing in those instructions: after you paste or type the text, you need to hit Esc to return vi to command mode before entering the :wq! to write and exit.


White Mini 9 | 2GB Transcend RAM | 16GB RunCore | 16GB Patriot Class 6 SDHC | Internal BT | 1505 802.11n | BIOS A05 | OS X 10.5.8
Thinking of trying Dropbox? Use this referal link and we'll both get an extra 250MB of storage.
Reply With Quote
  (#15) Old
Member
 
AlienWarrior75's Avatar
 
Posts: 59
Join Date: Aug 2009
Default 08-14-2009, 08:12 PM

HAHA!! This is awesome, well done dude


PlayStation2 SCPH-30001 v4.0 / Seagate 250GB
PlayStation2 SCPH-39001N v7.0 / Seagate 320GB HDLoader 0.8c / Memory Card Exploit
(+[__]%) PSP-1001k 98500 5.00 M33-6 2, 8 & 32GB MSPD
XBOX 360 Arcade 20GB LiteOn iXtreme 1.6 & Activate.iso Xbox LIVE Status: OK
Macbook Pro 2.4 i5 8GB 320GB Mac OS X 10.6.6
Dell Mini 10v 1GB 160GB Mac OS X 10.6.6 & Windows 7 RTM
A physicist is just an atom's way of looking at itself. N. Bohr
Reply With Quote
  (#16) Old
Member
 
stone's Avatar
 
Posts: 31
Join Date: Aug 2009
Location: austin, tx
Default 08-14-2009, 09:34 PM

FYI

the screencap and photo cap do not work with CRON. if you just execute the .sh manually it works, but the cron executes seems to run under slightly different premissions and it doesn't work. the photo cap doesnt even fire and the screencap returns a solid black image.

still working on a way to have it execute on a schedule. thinking launchd but i havent explored it yet.


dell mini 10v, running OSX 10.6.3, 160g hdd, 1.3 cam, 6 cell bat, 1gig ram, 1024x576 screen, usb logitech mouse, caselogic slipcase
Reply With Quote
  (#17) Old
Junior Member
 
Posts: 2
Join Date: Nov 2009
Default 11-21-2009, 06:21 AM

I used Lingon to create a launchd job, which will also watch a folder for changes and will only trigger the job when it sees a change. I created an empty folder in my dropbox (where I will upload a blank file if I need to enable tracking) and set the launchd job to run every 5 minutes once triggered. Seems to be working great!
Reply With Quote
  (#18) Old
Junior Member
 
Posts: 2
Join Date: Nov 2009
Default 11-21-2009, 07:44 PM

edit from my previous post. thought it was working, but checked the console and realized that the script needed a couple of edits. I used Lingon to make a new User Daemon that runs every 5 minutes. The launchd command is:
Code:
/Users/(osx login name)/Dropbox/tracking/tracking.sh >/dev/null 2>&1
and the script was modified as follows to get the paths correct and to eliminate the need to contact the dropbox servers at all:

Code:
USER_DB=/Users/(osx login name)/Dropbox/tracking

TRACKING_FILE=tracking.txt
TRACKING_ENABLED=$USER_DB/$TRACKING_FILE

TDATE=$(date +%Y%m%d%H%M)

if [ -f $TRACKING_ENABLED ]
then 

    # Dump IP/Airport info
    /sbin/ifconfig > $USER_DB/output/${TDATE}_Ifconfig.txt
    curl http://checkip.dyndns.org:8245/ > $USER_DB/output/${TDATE}_IP.txt
    /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I > $USER_DB/output/${TDATE}_airport.txt

    # Say cheese
    $USER_DB/isightcapture $USER_DB/output/${TDATE}_photo.jpg
fi
Now, instead of uploading a "tracking.txt" file containing the word "ture" in it to the Public directory, I just need to upload a file called "tracking.txt" to the tracking folder in my dropbox. It's not a big deal, but it got rid of a console error caused by the previous script trying to run the contents of the "tracking.txt" file in the command line (which could potentially be a vulnerability, as well).

This whole thing got me thinking...It would be pretty easy to set up another daemon to basically kill the user account and delete all of my personal files based on the same principal of a file moved into a "watch" folder in my dropbox...
Reply With Quote
  (#19) Old
Junior Member
 
Posts: 2
Join Date: Nov 2009
Default 11-22-2009, 06:36 PM

buddhaheadster > I'm having a spot of trouble getting the launchd thing to work. Installed Lingon, did this:

- created a new user daemon,
- named it,
- added the /Users/kitten/Dropbox/badger/tracking.sh >/dev/null 2>&1 to ProgramArguments
- checked RunAtLoad
- changed StartInterval to 300 (5 minutes)

Nothing seems to happen, so not sure if I'm missing some settings or something. Do I have to reboot for the job to take effect?

When I test your script by running it manually through terminal it works just fine, creating all 5 files (added screenshot), but they don't show up unless I run the file manually.

Any suggestions? =)


EDIT: I've renamed the folders to something less conspicuous - folder is now /badger/, and script runs if mushroom.txt is present. Also, I've moved the webcam line above the other ones inside the IF statement, seems to make webcam pictures more consistent. Before I moved the line I only got webcam shots on half of the test runs, now it seems to work every time. Still can't get launchd to work, though.
Reply With Quote
  (#20) Old
Senior Member
 
Posts: 154
Join Date: Oct 2009
Location: Pittsburgh, PA
Default 11-22-2009, 11:20 PM

subscribing to topic, im going to try it out tomorrow at work.


Mini 9 | 2gb RAM | 16GB SSD / 8GB SDHC | OS X 10.6.3 Snow Leopard | NBI 0.8.4RC1
Apple TV | 160GB | CrystalHD
iPhone 4
Powermac G5 Tower | 2x 2.0GHZ | 8GB Ram | 160+250 GB HDD | OS X 10.5.8 Leopard | 24" Acer
Reply With Quote
Reply

« Browser CPU and Battery Life | Tablet: 27 years and I still don't want one:) »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://www.mydellmini.com/forum/general-mac-os-x-discussion/8714-theft-tracking-method-mini-using-dropbox.html
Posted By For Type Date
Hey, Reddit - my wife's Macbook got smash'n'grabbed out of her mom's car two hours ago. Had I installed this script in her Dropbox beforehand, I might well have a picture and IP history of the perpetrator. : gadgets This thread Refback 11-21-2009 05:57 AM

Copyright © 2008-2011 MyDellMini.com.