[SOLVED] How can I use the `at` command in Mageia Terminal?

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] How can I use the `at` command in Mageia Terminal?

Postby tdmsoares » Jun 6th, '16, 00:00

I want to set my computer to suspend after 30 minutes from now. I already know how set to suspend my computer right now, I type the following in terminal:

Code: Select all
$ pm-suspend


Searching in internet, I found the solution is to type:

Code: Select all
$ echo pm-hibernate | sudo at now + 30 min


But when I type the above in my Terminal, I get that message: at: command not found

Is this command not default in Linux? Is it a command from a particular distro and, if so, how can I substitute it?

Thanks!
Last edited by tdmsoares on Jun 17th, '16, 00:47, edited 1 time in total.
tdmsoares
 
Posts: 19
Joined: May 18th, '16, 06:19
Location: Sao Paulo, Brazil

Re: How can I use the `at` command in Mageia Terminal?

Postby Ken-Bergen » Jun 6th, '16, 01:14

Your problem is not with at but with sudo
See
Code: Select all
man visudo
for information on setting up sudo.
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada

Re: How can I use the `at` command in Mageia Terminal?

Postby tdmsoares » Jun 6th, '16, 01:36

Even when I log as Root (not using `sudo`) I have the same problem
tdmsoares
 
Posts: 19
Joined: May 18th, '16, 06:19
Location: Sao Paulo, Brazil

Re: How can I use the `at` command in Mageia Terminal?

Postby Ken-Bergen » Jun 6th, '16, 02:54

As I didn't install "at" I assumed it was installed by default.
If you used the Live CD or DVD perhaps not.
Anyway it's in the repositories so install it and try again.
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada

Re: How can I use the `at` command in Mageia Terminal?

Postby doktor5000 » Jun 6th, '16, 18:47

Ken-Bergen wrote:If you used the Live CD or DVD perhaps not.

I think it's not even included in a regular install from DVD, as when I install chrome on a fresh install it always pulls in at ...
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18057
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: How can I use the `at` command in Mageia Terminal?

Postby tdmsoares » Jun 13th, '16, 01:04

`at` wasn't installed in my system... I just installed, but I found only the version for 32 bits...

After restarting the system, now I can type the command below without warnings:

Code: Select all
$ echo pm-suspend | sudo at now + 1 min


The only problem I'm facing now is that command doesn't work: after one minute, for example as above, the system doesn't suspend

Is there something I missed?
tdmsoares
 
Posts: 19
Joined: May 18th, '16, 06:19
Location: Sao Paulo, Brazil

Re: How can I use the `at` command in Mageia Terminal?

Postby Ken-Bergen » Jun 13th, '16, 03:09

tdmsoares wrote:The only problem I'm facing now is that command doesn't work: after one minute, for example as above, the system doesn't suspend

Is there something I missed?
It works for me.
Code: Select all
[ken@localhost]$ echo pm-suspend | sudo at now + 1 min
warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh                                                                     
job 4 at Sun Jun 12 17:54:00 2016
What do you see?
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada

Re: How can I use the `at` command in Mageia Terminal?

Postby tdmsoares » Jun 14th, '16, 01:00

I see the same warning, like the one you posted. In that case, probably you ran the command at 17:53 I guess...
The problem when the scheduled time comes, nothing happens...
I don't know if your computer suspended at 17:54, did it?
tdmsoares
 
Posts: 19
Joined: May 18th, '16, 06:19
Location: Sao Paulo, Brazil

Re: How can I use the `at` command in Mageia Terminal?

Postby Ken-Bergen » Jun 14th, '16, 05:24

tdmsoares wrote:I don't know if your computer suspended at 17:54, did it?
Yes it did.
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada

Re: How can I use the `at` command in Mageia Terminal?

Postby tdmsoares » Jun 15th, '16, 01:00

I don't know why the command doesn't work for me...
The only available version of `at` in repository was i586, my system is x86_64, does it make any difference?

Maybe the best solution is to uninstal `at` and make a workaround with crontab using shell script...

I am doing something like that in vim:

Code: Select all
sleep 60
pm-suspend
tdmsoares
 
Posts: 19
Joined: May 18th, '16, 06:19
Location: Sao Paulo, Brazil

Re: How can I use the `at` command in Mageia Terminal?

Postby Ken-Bergen » Jun 15th, '16, 02:38

tdmsoares wrote:I don't know why the command doesn't work for me...
The only available version of `at` in repository was i586, my system is x86_64, does it make any difference?
There is a 64bit version of at in the repositories which is what I have installed.
It would seem your sources are miss-configured or the mirror you're using is bad.
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada

Re: How can I use the `at` command in Mageia Terminal?

Postby doktor5000 » Jun 15th, '16, 17:42

Please show the output of
Code: Select all
urpmq --list-media active --list-url
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18057
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: How can I use the `at` command in Mageia Terminal?

Postby tdmsoares » Jun 16th, '16, 00:59

doktor5000 wrote:Please show the output of
Code: Select all
urpmq --list-media active --list-url


I get this:

Code: Select all
[tdms@localhost ~]$ urpmq --list-media active --list-url
Core Release cdrom://x86_64/media/core
Nonfree Release cdrom://x86_64/media/nonfree
Core Release2 http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/x86_64/media/core/release
Core Updates http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/x86_64/media/core/updates
Nonfree Release2 http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/x86_64/media/nonfree/release
Nonfree Updates http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/x86_64/media/nonfree/updates
Tainted Release http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/x86_64/media/tainted/release
Tainted Updates http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/x86_64/media/tainted/updates
Core 32bit Release http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/i586/media/core/release
Core 32bit Updates http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/i586/media/core/updates
Nonfree 32bit Release http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/i586/media/nonfree/release
Nonfree 32bit Updates http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/i586/media/nonfree/updates



I think I have both repositories for 32 and 64 bits. Why do I have a repository named Core Release and Core Release 2, is there any difference?
tdmsoares
 
Posts: 19
Joined: May 18th, '16, 06:19
Location: Sao Paulo, Brazil

Re: How can I use the `at` command in Mageia Terminal?

Postby Ken-Bergen » Jun 16th, '16, 01:32

Core Release cdrom: is a subset of the online Core Release2.
at is present on http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/x86_64/media/core/release so in a console as root
Code: Select all
urpme at
then
Code: Select all
urpmi at
should get you the x86_64 version.
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada

Re: How can I use the `at` command in Mageia Terminal?

Postby tdmsoares » Jun 16th, '16, 05:11

Ken-Bergen wrote:Core Release cdrom: is a subset of the online Core Release2.
at is present on http://ftp.las.ic.unicamp.br/pub/mageia/distrib/5/x86_64/media/core/release so in a console as root
Code: Select all
urpme at
then
Code: Select all
urpmi at
should get you the x86_64 version.


It finally worked!!! Thank you! :D
So, it was only a problem with the version of at, right? :?

Although the problem is solved, I have some questions remaining: Why in MCC before, it showed only the i586 version, and now only typing the code
Code: Select all
urpme at
and
Code: Select all
urpmi at
without any setup in repositories I could install the x86_64 version?

Is the i586 version not compatible with a 64 bits OS anymore?
tdmsoares
 
Posts: 19
Joined: May 18th, '16, 06:19
Location: Sao Paulo, Brazil

Re: How can I use the `at` command in Mageia Terminal?

Postby doktor5000 » Jun 16th, '16, 17:31

tdmsoares wrote:So, it was only a problem with the version of at, right? :?

No, not with the version but the architecture.

tdmsoares wrote:Although the problem is solved, I have some questions remaining: Why in MCC before, it showed only the i586 version, and now only typing the code without any setup in repositories I could install the x86_64 version?

urpmi will default to --strict-arch, so if there is the same package both for i586 and x86_64 and you only install a package by name it will always install the package for your native architecture.

In MCC if you explicitly select the i586 version, it will install that which is not what you want.
And in general you can run i586 code under x86_64, but not the other way around. Why it didn't work for at for you, is hard to tell without further information/debugging.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18057
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: How can I use the `at` command in Mageia Terminal?

Postby tdmsoares » Jun 17th, '16, 00:47

I think better than only solve the problems is to learn a little bit more
Thank you for the answers!
tdmsoares
 
Posts: 19
Joined: May 18th, '16, 06:19
Location: Sao Paulo, Brazil

Re: How can I use the `at` command in Mageia Terminal?

Postby doktor5000 » Jun 17th, '16, 16:18

tdmsoares wrote:I think better than only solve the problems is to learn a little bit more

Yes, exactly. Feel free to ask if anything is still unclear.

FWIW, usually I assume if people don't ask further questions than their needs are fulfilled. I stopped at some point explaining stuff to everybody in detail, as the vast majority of forum users will simply ignore it, and ask the same question few months later again, having not learned anything and having forgotten the several threads where they asked about that same issue already before :|
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18057
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest