Problem python script write text file on startup

Discussion in 'General Discussion' started by y.seksit, Jul 8, 2014.

  1. y.seksit

    y.seksit New Member

    Joined:
    May 8, 2014
    Messages:
    17
    Likes Received:
    0
    I have problem with python script. I run my python script on startup with rc.local, then, python script save some value to text file,

    normally, after start up udoo provide default user is "ubuntu", i test my python script to save text file, that file will get permission is "ubuntu"

    But when i start python script on startup with rc.local, after save text file then the permission of file is change to "root" and i cannot change any thing on that file, How can i fixed it?

    Example rc.local to startup my python script: sudo python /home/ubuntu/mypython.py &
     
  2. y.seksit

    y.seksit New Member

    Joined:
    May 8, 2014
    Messages:
    17
    Likes Received:
    0
    Now i can fix problem by use Crontab instance rc.local by add script to /etc/crontab as below

    use command:
    sudo nano /etc/crontab
    in crontab add:
    @reboot ubuntu python /home/ubuntu/mypython.py
     

Share This Page