Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7980643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:08:14+00:00 2026-06-04T10:08:14+00:00

I want to schedule a program that display history of a remote machine and

  • 0

I want to schedule a program that display history of a remote machine and stores it in a file in the local machine with timestamps(i.e which commands were executed when)
The code i used is this:

ssh -i private_key user@ip 'export HISTTIMEFORMAT=\"%D-%T \" ; \
                            export HISTFILE=/home/$user/.bash_history; \
                            set -o history; history' > myfile.txt

But instead of giving the correct time stamps it puts the present time in front of every command. So if the scheduler runs at say 9 o clock the time stamp for every command is 9 o clock.
Where am I going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:08:17+00:00Added an answer on June 4, 2026 at 10:08 am

    If BASHTIMEFORMAT isn’t set in a session, the timing information is not saved to the history file (otherwise it is saved as a comment in there).

    So unless the user you’re trying to log has that in his/her environment, you will not get timing information. It is simply not recorded, so impossible to retrieve.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .bat file in a Windows machine that starts our program by
I want to develop an app to display the programs schedule of a specific
I want to schedule my jasper report so that at a particular time, it
so..I'm trying to build a school schedule optimizer My program recieves a .dat file
I want to write a program in C++ that helps to manage my hockey
I'm writing a program for the Ubuntu distribution that I want to have larger
I've a main program which performs some task in Java. I want to run
I want to create a program so that what I say, Add Task. it
I want to schedule events to happen for my users. Is there an efficient
I want to schedule the email with asp.net and C# code. what is basic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.