notification when task is done
hi. i often upload files from my rpi2 to the cloud through terminal and it takes a long time. is there a way to get a notification(to my mac) when the task is done?
-
- Posts: 14048
- Joined: Fri Mar 09, 2012 7:36 pm
- Location: Vallejo, CA (US)
Re: notification when task is done
If you write a shell script and include notification code following the upload process, then, yes.
Almost all unix/Linux programs are designed to work silently. That is, no progress, no completion notice, though most of them will give a status value on exit so you can query that to determine if the program ran sucessfully or not.
Edit to add...this is where "verbose" flags come in. They will cause programs to give more (sometimes a *lot* more) feedback.
Almost all unix/Linux programs are designed to work silently. That is, no progress, no completion notice, though most of them will give a status value on exit so you can query that to determine if the program ran sucessfully or not.
Edit to add...this is where "verbose" flags come in. They will cause programs to give more (sometimes a *lot* more) feedback.
Re: notification when task is done
You are not using the terminal when uploading something, by using a Cronjob or such. If you are using a GUI with Linux, everything is going to run on the OS, not in X-Windows. You just need to make the Cron Job send an Email to local host for Root. Otherwise it will just show up in the logs after done.pyraylos wrote:hi. i often upload files from my rpi2 to the cloud through terminal and it takes a long time. is there a way to get a notification(to my mac) when the task is done?
Really you do not need to be notified when the task is done. You need to be notified when it fails or did not complete because of an error.
Ren: Now listen, Cadet. I've got a job for you. See this button? Ren: Don't touch it! It's the History Eraser button, you fool! Stimpy: So what'll happen? Ren: That's just it. We don't know. Maybe something bad, maybe something good.
-
- Posts: 690
- Joined: Tue Jun 16, 2015 6:01 am
Re: notification when task is done
Actually you may be surprised. There's quite a number of CLI File Transfer Protocols, like FTP, sFTP, SCP, rsync or even the old xmodem, although I think only us old router jocks still use that one flashing old Cisco equipment. But use what you have.broe23 wrote:You are not using the terminal when uploading something, by using a Cronjob or such.
That's kind of up to the OP, since they asked to how to be notified when the jobs completed and all.Really you do not need to be notified when the task is done. You need to be notified when it fails or did not complete because of an error.
Account Inactive
-
- Posts: 14048
- Joined: Fri Mar 09, 2012 7:36 pm
- Location: Vallejo, CA (US)
Re: notification when task is done
Pscp, kermit....SonOfAMotherlessGoat wrote: Actually you may be surprised. There's quite a number of CLI File Transfer Protocols, like FTP, sFTP, SCP, rsync or even the old xmodem, although I think only us old router jocks still use that one flashing old Cisco equipment. But use what you have.
Re: notification when task is done
Zmodem was always my favorite. And yeah, don't tell the OP that he doesn't want to do something that he very likely does want to do. In the old days, we often put an echo statement with a bunch of bells at the end of a script for something like this.W. H. Heydt wrote:Pscp, kermit....
- Pilosopong Tasyo
- Posts: 116
- Joined: Wed Apr 06, 2016 11:43 am
- Location: /root
Re: notification when task is done
On the Pi itself, it's easy. You can either have a visual or audio notification. The tools necessary to make it work are already installed. Sending a notification to a Mac involves a bit more work AFAIK. If you can SSH to your Mac from the Pi, and your Mac has the same or equivalent/similar CLI tools to make visual or audio notifications, it can be done. (Don't ask me what or how to use those equivalent MacOS tools are, as I have absolutely zero experience using a Mac.)pyraylos wrote:hi. i often upload files from my rpi2 to the cloud through terminal and it takes a long time. is there a way to get a notification(to my mac) when the task is done?
Give a man a ghoti and he'll eat for a day; teach him how to ghoti and he'll eat for life. Ghoti?! - http://i.imgur.com/mAfBUdi.png
How To Ask Questions The Smart Way - http://www.catb.org/esr/faqs/smart-questions.html
How To Ask Questions The Smart Way - http://www.catb.org/esr/faqs/smart-questions.html
Re: notification when task is done
I wonder if https://github.com/jpmens/mqttwarn isn't part of the answer?
I meant to look into it but that's still on my TODO list...
I meant to look into it but that's still on my TODO list...
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Re: notification when task is done
can you tell me how to do that on linux instead of mac?Pilosopong Tasyo wrote:If you can SSH to your Mac from the Pi, and your Mac has the same or equivalent/similar CLI tools to make visual or audio notifications, it can be done.
Re: notification when task is done
Mac OS-X runs on a derivative of BSD. Pretty much anything you can do in Linux, you can do in OS-X.
Ren: Now listen, Cadet. I've got a job for you. See this button? Ren: Don't touch it! It's the History Eraser button, you fool! Stimpy: So what'll happen? Ren: That's just it. We don't know. Maybe something bad, maybe something good.
- Pilosopong Tasyo
- Posts: 116
- Joined: Wed Apr 06, 2016 11:43 am
- Location: /root
Re: notification when task is done
When you...pyraylos wrote:can you tell me how to do that on linux instead of mac?Pilosopong Tasyo wrote:If you can SSH to your Mac from the Pi, and your Mac has the same or equivalent/similar CLI tools to make visual or audio notifications, it can be done.
in what manner do you do it? Do you have a KB/M+monitor attached to the Pi2, have a full desktop running and you upload files from the Pi desktop itself? Or does the Pi2 run headless and you use your Mac to remotely connect to the Pi2 via SSH and upload files that way?pyraylos wrote:...upload files from my rpi2 to the cloud through terminal...
Giving us relevant details on how you do things on your end gives us a better idea how to approach your problem.
Give a man a ghoti and he'll eat for a day; teach him how to ghoti and he'll eat for life. Ghoti?! - http://i.imgur.com/mAfBUdi.png
How To Ask Questions The Smart Way - http://www.catb.org/esr/faqs/smart-questions.html
How To Ask Questions The Smart Way - http://www.catb.org/esr/faqs/smart-questions.html
Re: notification when task is done
the rpi2 runs headless and i use my mac to connect via ssh.
Re: notification when task is done
I will ask, how do you/what do you do to upload to whatever cloud.
As mentioned up there, there are plenty of file transfer protocols, or maybe this is to OneDrive/DropBox/MacEquivCloud style cloud storage?
Would an email suffice?
As mentioned up there, there are plenty of file transfer protocols, or maybe this is to OneDrive/DropBox/MacEquivCloud style cloud storage?
Would an email suffice?
Re: notification when task is done
If you're connecting to the pi from the terminal on the mac and just run a simple command, you could do something like:
ssh raspberrypi2 scp filename cloud: ; <mac notification command here>
This will simply log you in via ssh, run the command - and when it's done, run whatever you type after the semicolon on the mac. I remember growl having a simple command-line-notification-command but I haven't used that in ages.
ssh raspberrypi2 scp filename cloud: ; <mac notification command here>
This will simply log you in via ssh, run the command - and when it's done, run whatever you type after the semicolon on the mac. I remember growl having a simple command-line-notification-command but I haven't used that in ages.
- Pilosopong Tasyo
- Posts: 116
- Joined: Wed Apr 06, 2016 11:43 am
- Location: /root
Re: notification when task is done
The OP can do a search in his favorite search site for the following terms:jayminer wrote:<mac notification command here>
a. for visual cue - mac osx equivalent to zenity
b. for audio cue - mac osx equivalent to aplay
Give a man a ghoti and he'll eat for a day; teach him how to ghoti and he'll eat for life. Ghoti?! - http://i.imgur.com/mAfBUdi.png
How To Ask Questions The Smart Way - http://www.catb.org/esr/faqs/smart-questions.html
How To Ask Questions The Smart Way - http://www.catb.org/esr/faqs/smart-questions.html