Thursday 6 October 2016

Setting Cron Jobs & Folder Sharing in Ubuntu

Commands to set cronjobs in Ubuntu

Login Via root in ubuntu
sudo su
Give Password
type crontab -e

Now a tab will appear, their give crontab line like:-

eg: 30 23 * * * wget http://localhost/crm/yourscript.php
for running a script at  11.30 pm


Folder Sharing

The Procedure is we have to create a user, & group. Then add that user to a group , then at last give permission to the folder for this usergroup.. The commands will be explained with an example below:-

1) Create a User named for eg; developer
adduser developer
smbpasswd -a developer
smbpasswd  -e developer
Give password


2)Create a group named developers

sudo addgroup developers

3) Add User to Group

sudo adduser developer developers

4) Give permission to that folder to the user group

chown -R developer:developers /var/www/foldername

5) Now we have to check whether we installed samba in the computer
Try running this code , If its alreday installed then no pblm.. otherwise install.

sudo apt-get install samba
6) Now in the terminal type like this:-

gksudo gedit /etc/samba/smb.conf

7) Now a file will be opened, in it after the [printer] definition include some lines like this:-

[foldername]
       
        comment = share
        browseable = yes
        path = /var/www/html
       printable= no
       guest ok = yes
       readonly = no
       writable = yes
       valid users = @developers
       write list = developer
      create mask = 0775
      directory mask = 0775



No comments:

Post a Comment