src/main.c
void signal_handler(int sig_no)
{
    if (sig_no == SIGINT)
    {
        openlog("Assignment1", LOG_PID | LOG_CONS, LOG_USER);
        syslog(LOG_INFO, "SIGINT interrupt recieved");
        closelog();
    }
    else if (sig_no == SIGUSR1)
    {
        openlog("Assignment1", LOG_PID | LOG_CONS, LOG_USER);
        syslog(LOG_INFO, "SIGUSR1 interrupt recieved");
        closelog();
        //call functions
        lock_dir();
        backup();
        transfer();
        unlock_dir();
    }
}
//call the functions when the user sends a SIGUSR signal
call the functions when the user sends a SIGUSR signal
call the functions when the user sends a SIGUSR signal
void signal_handler(int sig_no)
{
    if (sig_no == SIGINT)
    {
        openlog("Assignment1", LOG_PID | LOG_CONS, LOG_USER);
        syslog(LOG_INFO, "SIGINT interrupt recieved");
        closelog();
    }
    else if (sig_no == SIGUSR1)
    {
        openlog("Assignment1", LOG_PID | LOG_CONS, LOG_USER);
        syslog(LOG_INFO, "SIGUSR1 interrupt recieved");
        closelog();
        lock_dir();
        backup();
        transfer();
        unlock_dir();
    }
}
void signal_handler ( int sig_no ) { if ( sig_no == SIGINT ) { openlog ( " " , LOG_PID | LOG_CONS , LOG_USER ) ; syslog ( LOG_INFO , " " ) ; closelog ( ) ; } else if ( sig_no == SIGUSR1 ) { openlog ( " " , LOG_PID | LOG_CONS , LOG_USER ) ; syslog ( LOG_INFO , " " ) ; closelog ( ) ; lock_dir ( ) ; backup ( ) ; transfer ( ) ; unlock_dir ( ) ; } }
call the functions when the user sends a SIGUSR signal
call the functions when the user sends a SIGUSR signal
//call functions